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

GridEditableItem.ExtractValues issue

3 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 2
Nick asked on 15 Jun 2012, 09:59 PM
Hello,

I am using the ExtractValues method in my UpdateCommand method to retrieve a mapping of column names to values from an edited row. However, when I edit a row, the value mapped to its column stays the same in the hashtable, as well as in the grid. What could be the possible explanations for this?

protected void GrdConfig_UpdateCommand(object sender, GridCommandEventArgs e)
{
     Hashtable newValues = new Hashtable();
     ((GridEditableItem)e.Item).ExtractValues(newValues);
     Alert.Show(newValues["ColumnName"].ToString());
     ...
     Working SQL code
     ...
}

3 Answers, 1 is accepted

Sort by
0
Nick
Top achievements
Rank 2
answered on 18 Jun 2012, 11:37 AM
If anyone has had this problem as well, any help would be greatly appreciated because I am stuck at a wall right now.

-Nick
0
Nick
Top achievements
Rank 2
answered on 18 Jun 2012, 02:25 PM
I was able to (almost) fix my problem by changing the code where I retrieve the data from the DB to the PreRender method (it was originally in the PageLoad method). I am able to update one cell, and it displays on the grid and in the DB. However, I am trying to use an iterator to loop through the newValues and update each value in the database, how can I do this?

-Nick
0
Pavlina
Telerik team
answered on 20 Jun 2012, 03:11 PM
Hi Nick,

I suggest that you examine the online resources below which demonstrate how to force several grid items in edit mode and then update them on single button.
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultvb.aspx
http://www.telerik.com/help/aspnet-ajax/grid-performing-batch-updates.html

I hope they will help you to achieve the desired functionality.

Kind regards,
Pavlina
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
Nick
Top achievements
Rank 2
Answers by
Nick
Top achievements
Rank 2
Pavlina
Telerik team
Share this question
or