In my gridRowUpdating() event, I perform some client-side validation. If the validation doesn't pass, I cancel the update by calling e.set_cancel(true);
This works fine, except for this big caveat: the row will then revert back to its original values. This is bad because all the information that the user provided then goes away, and he has to start all over again!
Is there any way to cancel the Gridview's Update, without clearing out the data in the row?
*bump*
Any help on this guys?
Unfortunately the grid assumes that the action for the row is canceled completely and returns old values for the whole row.
I can suggest to remember all of the cell values in the rowUpdating event handler and then write a helper function that will be executed on a timeout which would call set_value for each cell and set the new values on the row cells again.
Alex, I am in the exact same boat, except for me it is the ADD function.
Can you give more detail on exactly how you would write what you are suggesting to do?
/Tom
Do you mean you should use something like a timer event to re-populate the new row? I really dont like that.
Is there really no elegant way to do this? Maybe some event that we can hook into after the updaterow event. Or something we can override to prevent the row from clearing?
I would imagine this is pretty standard stuff, but after spending a day on finding a solution I'm really stuck on this.
If you have any other ideas, im very interested.
*edit: I'm aware this is an old thread, but it is exactly what i'm looking for..
If this is not the way to do row validation, how would you suggest to do it?