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

Using Datatable in insertcommand to store the items

1 Answer 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 04 Dec 2012, 11:22 AM
Hi,
I am trying to do a soft save of the grid items to  a datatable, when add new item is clicked.

Currently i am using the hashtable to store the data. However, i would like to add those items to datatable.

GridEditableItem item = e.Item as GridEditableItem;
          Hashtable values = new Hashtable();
          DataTable dt = new DataTable();            
          item.ExtractValues(values);

How to add the values to the datatable?
Thanks

1 Answer, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 07 Dec 2012, 08:06 AM
Hi Venkatesh,

You have posted three questions related to a similar issue for doing a save operation in a insert command event and providing similar code. In order to provide you with the best possible solution you could open a formal ticket an give us a step by step instructions on the desired functionality. 

In the described scenario you could loop through all the values(Hashtable) variable and append them as a new row in the DataTable as shown in the example below.

All the best,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Share this question
or