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

how to update grid values during UpdateCommand event?

2 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
tony
Top achievements
Rank 1
tony asked on 09 May 2012, 05:00 AM
is it possible to change the contents of a grid during the updatecommand event which is generated by the grid's autogenerated update link? this should be a trivial operation taking 2 lines of code but it is proving to be anything but.

could someone post a code example? i just want to see the c# code in the updatecommand event. no fancy example - just show me how to change the value of column 1 to "something". i do not expect to have to muck around with the data source or anything else related to database data but my application is using entitydatasource and entity framework - again this should be irrelevant.....somehow i don't think it is....

i would expect to use the command arguments alone but somehow i feel it will be more involved.

2 Answers, 1 is accepted

Sort by
0
tony
Top achievements
Rank 1
answered on 09 May 2012, 05:02 AM
ps....when the event finishes, the grid should display the new value set in the event.
0
Richard
Top achievements
Rank 1
answered on 11 May 2012, 02:27 PM
Tony:

If you implement updates/inserts for your grid instance using one the approaches for data extraction presented below:

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editmodes/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/extractvalues/defaultcs.aspx

and you verify that the underlying source is modified, the grid should reflect the changes made.

Both of the above demos use Advanced Data Binding and implement

protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)


Hope this helps!
Tags
Grid
Asked by
tony
Top achievements
Rank 1
Answers by
tony
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or