This is a migrated thread and some comments may be shown as answers.

[Solved] Read selected row values from Telerik gridview

1 Answer 146 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
nisha marford
Top achievements
Rank 1
nisha marford asked on 25 Nov 2009, 10:45 AM
Can anyone plz tell me how to read the selected row values from gridview.

Below is the code i have used. First column is checkbox.

 

 

<

ComboBox Name="drpUser" Width="170" SelectionChanged="bindUserGroup" SelectedItem="{Binding UserID, Mode=TwoWay}" DisplayMemberPath="strFirstname" VerticalAlignment="Bottom" ItemsSource="{Binding}" Foreground="Black" Margin="80,10,30,10"/>

 

 

 

 

 

 

 

<telerikGridView:RadGridView x:Name="RadGridUSerGroup" IsFilteringAllowed="False" MultipleSelect="True" ItemsSource="{Binding}" AutoGenerateColumns="False" CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserSortColumns="False" Margin="50,30,30,10" FontSize="10.667" HorizontalAlignment="Left" Width="800">

 

<telerikGridView:RadGridView.Columns 

 

 

 

<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding GroupStatus, Mode=TwoWay}" />  

 

 

<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding strUserGroup}" Header="Group Name" />  

 

 

</telerikGridView:RadGridView.Columns 

 

 

</telerikGridView:RadGridView>

 

 

 

i need to get the group names for the selected (checkbox checked) rows.

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 30 Nov 2009, 10:53 AM
Hi nisha marford,

You could easily do this by looping through all selected items:

private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
    List<string> groupNames = new List<string>();
  
    foreach (MyDataType selectedItem in this.myGrid.SelectedItems)
    {
        groupNames.Add(selectedItem.strUserGroup);
    }
}

Hope this helps.

All the best,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
nisha marford
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or