Get the Value or content of Selected Row of Gridview in WPF

Posted by Syedshakeer under WPF on 10/18/2010 | Points: 10 | Views : 10851 | Status : [Member] | Replies : 1
I had created a GridView using ListView and Binded data in it.How i can get the value (or)Content of SelectedRow of a Particular Column in Gridview.

Below is code xaml code.

<ListView ItemContainerStyle="{StaticResource CustomListViewItemStyle}" AlternationCount="2" BorderBrush="Black" BorderThickness="0" Name="listviewRecentHistory" ItemsSource="{Binding}" Height="Auto" Width="880" HorizontalAlignment="Left" Background="Transparent" SelectionChanged="listviewRecentHistory_SelectionChanged">

 <GridViewColumn Width="60" Header="Job Id">
<DataTemplate >
<Hyperlink Cursor="Hand" Click="hyperlink_Click" >
<TextBlock Name="text" Text="{Binding JobID}" ToolTip="{Binding BatchID}">


Syed Shakeer Hussain


Posted by: Abhi2434 on: 10/18/2010 [Member] [Microsoft_MVP] [MVP] Silver | Points: 25


If you make IsSynchronizedWithCurrentItem to true, the CollectionView will hold the Current item in context. See my article on CollectionView, I did the same thing :

I hope this would help you.

Syedshakeer, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response