I am having an issue retaining the values in a popup form if the save of the underlying object is not successful. Specifically, I am using a custom ObjectDataSource and handling its Inserting event. I then attempt to create a new object, bind it's value to those found on the popup's controls, and save the object in a try/catch block.
If the save throws an exception, I set a class level variable (_errorOccurred) to true. Then, I handle the Grid's ItemUpdated event as shown below:
If the save throws an exception, I set a class level variable (_errorOccurred) to true. Then, I handle the Grid's ItemUpdated event as shown below:
| protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e) |
| { |
| e.KeepInEditMode = _errorOccurred; |
| } |
What this does is keeps the popup open, which works great. However, all of the values are lost, and the user has to re-enter all of the values.
How do I retain the values in the popup in this case?
Thanks!