Click here to Skip to main content
15,894,740 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: default control template xaml Pin
Bob Bedell9-Jul-09 12:04
Bob Bedell9-Jul-09 12:04 
GeneralRe: default control template xaml Pin
Bob Bedell9-Jul-09 16:12
Bob Bedell9-Jul-09 16:12 
GeneralRe: default control template xaml Pin
Bob Bedell11-Jul-09 4:08
Bob Bedell11-Jul-09 4:08 
Questiontextbox - select all Pin
teejayem8-Jul-09 6:07
teejayem8-Jul-09 6:07 
AnswerRe: textbox - select all Pin
User 2710099-Jul-09 18:23
User 2710099-Jul-09 18:23 
QuestionMessage Removed Pin
8-Jul-09 3:45
professionalN_tro_P8-Jul-09 3:45 
AnswerRe: WPF Charting Pin
Pete O'Hanlon8-Jul-09 4:41
mvePete O'Hanlon8-Jul-09 4:41 
QuestionListview binding is not working with page class Pin
laprathab7-Jul-09 21:50
laprathab7-Jul-09 21:50 
Hi,

I tried to bind the list view with combo box, following code worked fine with Window1.xaml the same was not working in Page1.xaml. Any one pls help to solve the above. Thanks in advance.

My Xaml Code is:
<Page x:Class="WPFtest.ComboTest"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WPFtest"  
    Title="ComboTest">
    <Page.Resources>
        <local:BoolToVisibilityConverter x:Key="boolToVis" />

        <Style TargetType="{x:Type TextBlock}" 
           x:Key="GridBlockStyle">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Visibility" 
              Value="{Binding Path=IsSelected, 
              RelativeSource={RelativeSource FindAncestor, 
                        AncestorType={x:Type ListViewItem}},
              Converter={StaticResource boolToVis}, 
                         ConverterParameter=False}" />
        </Style>

        <Style TargetType="{x:Type FrameworkElement}" 
           x:Key="GridEditStyle">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Visibility" 
              Value="{Binding Path=IsSelected, 
              RelativeSource={RelativeSource FindAncestor, 
                        AncestorType={x:Type ListViewItem}},
              Converter={StaticResource boolToVis}, 
                         ConverterParameter=True}" />
        </Style>

    </Page.Resources>
    <StackPanel>
        <TextBox Height="23" Name="textBox1" Width="120" />
        <Button Height="23" Name="btnTest" Content="test" Width="120" Click="btnTest_Click"></Button>
        <ListView x:Name="gameListView" ItemsSource="{Binding Path=GameCollection}">
            <ListView.View>
                <GridView>

                    <GridViewColumn Width="140">
                        <GridViewColumnHeader Click="SortClick" 
                                  Tag="GameName" 
                                  Content="Game Name" />
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding Path=GameName}"  Style="{StaticResource GridBlockStyle}"/>
                                    <TextBox Text="{Binding Path=GameName}" Style="{StaticResource GridEditStyle}" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>

                    <GridViewColumn Width="140">
                        <GridViewColumnHeader Click="SortClick" Tag="Creator" Content="Creator" />
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding Path=Creator}"  Style="{StaticResource GridBlockStyle}"/>

                                    <ComboBox Name="cmbTest1" SelectedItem="{Binding Path=RoleID}" DisplayMemberPath="RoleName" SelectedValuePath="RoleID" ItemsSource="{Binding ElementName=This,Path=AvailableRoles}" Style="{StaticResource GridEditStyle}" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>

                    <GridViewColumn Width="140">
                        <GridViewColumnHeader Click="SortClick" 
                                  Tag="Publisher" 
                                  Content="Publisher" />
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid HorizontalAlignment="Stretch">
                                    <TextBlock Text="{Binding Path=Publisher}" Style="{StaticResource GridBlockStyle}"/>
                                    <ComboBox Name="cmbTest" SelectedItem="{Binding Path=DeptID}" DisplayMemberPath="DeptName" SelectedValuePath="DeptID" ItemsSource="{Binding ElementName=This,Path=AvailablePublishers}" Style="{StaticResource GridEditStyle}" SelectionChanged="ComboBox_SelectionChanged" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    

                </GridView>
            </ListView.View>
        </ListView>
        <Button HorizontalAlignment="Right" Margin="5" Content="Add Row" Click="AddRowClick" />

    </StackPanel>
</Page>

AnswerRe: Listview binding is not working with page class Pin
User 2710097-Jul-09 22:05
User 2710097-Jul-09 22:05 
GeneralRe: Listview binding is not working with page class Pin
laprathab7-Jul-09 23:11
laprathab7-Jul-09 23:11 
GeneralRe: Listview binding is not working with page class Pin
User 2710097-Jul-09 23:17
User 2710097-Jul-09 23:17 
GeneralRe: Listview binding is not working with page class Pin
laprathab7-Jul-09 23:32
laprathab7-Jul-09 23:32 
GeneralRe: Listview binding is not working with page class Pin
User 2710097-Jul-09 23:37
User 2710097-Jul-09 23:37 
GeneralRe: Listview binding is not working with page class Pin
laprathab7-Jul-09 23:47
laprathab7-Jul-09 23:47 
GeneralRe: Listview binding is not working with page class Pin
User 2710097-Jul-09 23:51
User 2710097-Jul-09 23:51 
GeneralRe: Listview binding is not working with page class Pin
laprathab7-Jul-09 23:55
laprathab7-Jul-09 23:55 
GeneralRe: Listview binding is not working with page class Pin
User 2710098-Jul-09 0:05
User 2710098-Jul-09 0:05 
GeneralRe: Listview binding is not working with page class Pin
laprathab8-Jul-09 0:24
laprathab8-Jul-09 0:24 
QuestionHow to use xamDataGrid in VS2005/VS2008 Pin
jgotlt7-Jul-09 20:14
jgotlt7-Jul-09 20:14 
AnswerRe: How to use xamDataGrid in VS2005/VS2008 Pin
User 2710097-Jul-09 21:40
User 2710097-Jul-09 21:40 
GeneralRe: How to use xamDataGrid in VS2005/VS2008 Pin
Pete O'Hanlon7-Jul-09 22:00
mvePete O'Hanlon7-Jul-09 22:00 
QuestionElementFlow Intergration - FluidKit Pin
lxmyers7-Jul-09 14:33
lxmyers7-Jul-09 14:33 
QuestionEntity translator Pin
Member 35268517-Jul-09 1:28
Member 35268517-Jul-09 1:28 
AnswerRe: Entity translator Pin
Pete O'Hanlon7-Jul-09 1:36
mvePete O'Hanlon7-Jul-09 1:36 
QuestionHow To Host Silver Light User Controls to asp.net Page Contaning webParts Pin
Member 47046757-Jul-09 1:06
Member 47046757-Jul-09 1:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.