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

[Solved] keep open radwindow popup of add/edit form from code behindcode behind

1 Answer 185 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sac
Top achievements
Rank 1
Sac asked on 19 Jul 2013, 11:05 AM
Hi,

I have a radgrid and for add / edit I have external control of WebUserControl.ascx.
I open popup radwindow and show that control in that..

Now, when saving on that control I want to validate from database and show error on popup but when a postback occurs popup closed and entered data also lost. I want to keep popup open and show error.

How can I achieve that..???
any help would be appreciated...

Thanks in advance...

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 24 Jul 2013, 10:15 AM
Hello Sac,

I am attaching a simple, runnable project with your scenario. You will find two approaches for the input validation:
  1. Using the grid ItemCommand event handler for custom validation and cancel the command if validation fails. This will keep the user control edit form open, even after postback. 
  2. Using RequiredFieldValidator (or any other validators). The validators will cancel the current command and will keep the edit form open. Error messages from the validators can be shown on invalid input. For this approach all server-side logic in the sample is not needed and could be removed. 

I have also demonstrated how to access and display error message in the user control for the first approach.


Hope this helps. 
 
Best Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Sac
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or