Not able to select a row in my ListView
Posted
by
Krishna Thota
on Stack Overflow
See other posts from Stack Overflow
or by Krishna Thota
Published on 2013-06-29T02:41:02Z
Indexed on
2013/06/29
4:21 UTC
Read the original article
Hit count: 180
I'm not able to select a row in my list Item
Here is my code
<Grid DockPanel.Dock="Left" MinWidth="250">
<ListView x:Name="ListVendors" ItemsSource="{Binding SourceCollection}">
<ListView.View>
<GridView>
<GridView.ColumnHeaderContainerStyle>
<Style><Setter Property="FrameworkElement.Visibility" Value="Collapsed"/></Style>
</GridView.ColumnHeaderContainerStyle>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{Binding Name}" FontSize="20"/>
<TextBlock Grid.Row="1" Text="{Binding Code}" Foreground="Gray" />
<TextBlock Grid.Row="2" Text="{Binding ContactNo}" Foreground="Gray" />
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{Binding Path=Address, Converter={StaticResource addNewLineConv}}" Grid.RowSpan="3" />
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Row="2" Text="{Binding Email}"/>
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding Email}" Header="Email"/>
</GridView>
</ListView.View>
</ListView>
How can I select a row in this ListView?
© Stack Overflow or respective owner