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

RadGRid Get Edit Row Cell Values

3 Answers 1008 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Silviu
Top achievements
Rank 1
Silviu asked on 22 Apr 2015, 11:11 AM

I have a RadGrid with a bunch of columns i.e:

ID    | Name      | Address       | Phone Number
1     | John Doe | 123 Fake St  | 1234567

Wehen I click Edit on a row I want to be able to get the ID value, which is 1.

 

How do I do that? I've searched through the API and wasn't able to find a concrete example.

I am using EditFormType="Template" for the RadGrid

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 27 Apr 2015, 12:14 PM
Hi,

You can access the edit cell value Client-side using the code snippet below.
function command(sender, eventArgs)
{
 var grid = $find("<%= RadGrid1.ClientID %>");
 var masterTableView = grid.get_masterTableView();
 var editItem = masterTableView.get_editItems()[0];
 var cellValue = editItem.getDataKeyValue("ID");
}

Regards,
Pavlina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Silviu
Top achievements
Rank 1
answered on 27 Apr 2015, 12:26 PM
Thanks. But I need that in CodeBehind.
0
Pavlina
Telerik team
answered on 28 Apr 2015, 03:05 PM
Hi,

You can refer to the article below for more information about accessing cells and rows in edit mode
​http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html

Regards,
Pavlina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
Silviu
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Silviu
Top achievements
Rank 1
Share this question
or