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

[Solved] Insert and Update Ajax:Grid

1 Answer 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rks
Top achievements
Rank 1
rks asked on 21 Jul 2009, 02:50 AM
Hi,
I use ajaxified grid and I want to implement Batch Updates and Insertions from code behind. I have GridDropDown columns and GridDateTime Column. But, when I try to obtain the updated values it only renders "null". It does not update with new values, old values are still displayed.

Here is my code:

 

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

if (e.CommandName == "UpdateAll")

 

{

 

foreach (GridEditableItem editedItem in RadGrid1.EditItems)

 

{

 

Hashtable newValues = new Hashtable();

 

e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);

 

int usr_id = int.Parse(newValues["usr_id"].ToString());

 

 

int sys_id = int.Parse(newValues["sys_id"].ToString());

 

 

int role_id = int.Parse((editedItem["role_id"].Controls[0] as DropDownList).SelectedItem.Value.ToString());

 

}
}
}

Please help..
Thanks,
RKS

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 23 Jul 2009, 03:36 PM
Hello rks,

Do you use edit forms type of editing for the grid? If so, you should have in mind the detail for the EditItems collection explained at the bottom section of this documentation topic:

http://www.telerik.com/help/aspnet-ajax/grdeditforms.html

In essence, you will need to reference the GridEditFormItem instance and extract the new values from it.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
rks
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or