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

An easier way to get grid values in UpdateCommand

2 Answers 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Iron
Iron
Iron
Al asked on 08 Dec 2014, 03:14 PM
Hi,

I am reading grid cell values in the UpdateCommand event after the 'update' button on my grid is clicked. This code is working:

    var Irn = editableItem["Irn"];
    int iIrn = (int)((RadNumericTextBox)Irn.Controls[0]).Value;

But my problem is that I don't know what control type to use when doing the type cast, I mean for text data it comes out as 'System.Web.UI.WebControls.TextBox' which I didn't expect.

Surely there is a better way to do this?

2 Answers, 1 is accepted

Sort by
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 09 Dec 2014, 06:56 AM
I found my answer:

Hashtable values = new Hashtable();
editableItem.ExtractValues(values);
0
Eyup
Telerik team
answered on 11 Dec 2014, 11:58 AM
Hello Al,

I'm glad you've managed to find the answer by yourself.
I guess you are aware of the following live sample for real-time implementation:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/manual-crud-operations/defaultcs.aspx

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Eyup
Telerik team
Share this question
or