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

Selected index Row in Grid

2 Answers 252 Views
Grid
This is a migrated thread and some comments may be shown as answers.
samarth
Top achievements
Rank 1
samarth asked on 15 Nov 2010, 09:48 AM
Hi
How can I find Selected Row in telerik grid

How Can i selected perticular row

Suggest me the event name for selected row  in telerik rad grid control




  

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 Nov 2010, 10:19 AM
Hello Samanth,

The following code snippet shows how to find the selected rows in RadGrid.
C#:
GridDataItem selectedItem = (GridDataItem)RadGrid1.SelectedItems[0];

If more than one grid rows selected, then you can loop through each row like below.
foreach (GridDataItem item in RadGrid1.SelectedItems)// if more than one item selected
   {
 
   }

Try the following code snippet to select the first row in a grid.
RadGrid1.Items[0].Selected = true;

And there is 'onselectedindexchanged' event for RadGrid which will fire when selecting a row in grid.
protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
   {
 
   }

Note: you should set EnablePostBackOnRowClick of ClientSettings as "true" to fire the 'onselectedindexchanged event.

Thanks,
Princy.
0
samarth
Top achievements
Rank 1
answered on 15 Nov 2010, 10:54 AM
Thanks Princy !
Tags
Grid
Asked by
samarth
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
samarth
Top achievements
Rank 1
Share this question
or