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

[Solved] How to get the selected rows of the grid?

1 Answer 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
anonym
Top achievements
Rank 1
anonym asked on 12 May 2009, 09:51 AM
I have put in the RadGrid these column:

<telerik:GridClientSelectColumn />  

Now want to get these selected rows in code behind, can you give me please an example. I only need the foreignkey of the row.



1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 May 2009, 11:07 AM
Hi,

Try the following code snippet to loop  through the Selected rows in a Grid. Set the required key field as the DataKeyName.

ASPX:
 
<MasterTableView  DataKeyNames="SupplierID"  > 

CS:
 
  foreach (GridDataItem item in RadGrid1.SelectedItems) 
        { 
            string strKey = item.GetDataKeyValue("SupplierID").ToString(); 
        } 


Shinu
Tags
Grid
Asked by
anonym
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or