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

access cell values in radgrid selected index event

3 Answers 683 Views
Grid
This is a migrated thread and some comments may be shown as answers.
abinav
Top achievements
Rank 1
abinav asked on 29 Nov 2010, 12:02 PM
hi

i have a grid with some datas in it when i select a row or column the corresponding items has to get binded to the text box outside the grid what should i do to achieve this pl tell  me  a good suggestion and i need an immediate reply

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 29 Nov 2010, 12:45 PM
Hello Abhinav,

The following code snippet shows how to access the selected item cell values in SelectedIndexChanged event of RadGrid.

C#:
protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
   {
       GridDataItem item = (GridDataItem)RadGrid1.SelectedItems[0];
       string id = item["ColumnUniqueName"].Text; // accessing selected cell values
   }

Thanks,
Princy.
0
abinav
Top achievements
Rank 1
answered on 29 Nov 2010, 01:19 PM
hi princy thanks

but how to do it using template field?
0
Pavlina
Telerik team
answered on 29 Nov 2010, 01:29 PM
Hello Abinav,

For template columns you must find the control in the grid cell and extract its value. You need to access the GridDataItem and get reference to control using the FindControl(controlId) method. More information is available here:
http://www.telerik.com/help/aspnet-ajax/gridreferencecontrolsinroweditform.html

Best wishes,
Pavlina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
abinav
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
abinav
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or