We have radgrids with edit templates. In some cases, two different radgrids display records from the same database table. In these cases, the records are editable from either radgrid, so we’re made a user control and placed it in the radgrid’s edit template form. We would also like to display a radalert box if a field if left blank, or contains any other invalid data, and this is where the problem starts.
If the command name of the submit button, located in the user control, is set to “update”, it causes the radgrid’s UpdateCommand event to fire, in the main aspx page. And this event apparently fires before the submit button’s click event fires, and since the radgrid’s UpdateCommand event handler closes the edit template, any attempt to display a radalert from the submit button’s click event fails.
The obvious fix is to not set the command name=update property of the submit button, right? Well, maybe, but if we do that, then the edit template never closes, even after a successful record update. We could try to close the edit template “manually” from the user control’s submit button click event, but we’ve been unable to do that so far, and it’s probably bad design to do anyway.
So, my question is this: What do you recommend as a strategy for “reusing” an edit template between multiple radgrids if you can’t use user controls?
(IIS 7.5, Windows Server 2012, VS 2012, C#, ASP.NET, Telerik runtime version 4.0.30319, IE11, Firefox 45.0)