Hi,
I have defined a RowEditTemplate in the definition of my UltraWebGrid, double clicking on any of whose rows would popup that layout defined in RowEditTemplate. I have a Save button in that layout which would update any of my data changes in the database. I am catching the click event of this save button in my webgrid's Item_Command event. But whenever i click this save button, i get a run time error which says "Invalid PostBack or CallBack Argument". I am unable to figure out where exactly am i going wrong. Any sort of help would be highly beneficial.
Thank You.
By the time your page hits the server, the grid has no reference to the controls it had rendered to the client, so your page has no idea what control caused the postback or what event to raise. Because of this, you shouldn't try to respond to server-side events on controls in your row edit template, or use controls that need to cause a postback in the row edit template.
Instead, you should copy your changes back to the corresponding WebGrid cell. Information on how to do this is provided in the following article from our online Knowledge Base:HOWTO: Placing complex controls in the row edit template
To deal with updating the code on the server, you can then handle the grid's UpdateRow or UpdateRowBatch event.
If you need the server to be hit immediately, use the UpdateRow event. In the code in your AfterRowTemplateClose client-side event handler, call the row's processUpdateRow() function. If you don't call this function, the grid won't post back until you either switch rows or the grid loses focus.