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

How to validate Grid / User Control Edit Form

3 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mac P
Top achievements
Rank 1
Mac P asked on 26 Mar 2010, 03:57 AM
Hi,

I want to validate usercontrol controls (client and server side) as the result of add/edit item of the grid.
Please refer to example from telerik website.
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx

I have set required field validator to the usercontrol fields but it doesnt fire validators on postback.
Any example is appreciated.

regards
Mac

3 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 30 Mar 2010, 05:35 PM
Hello Mac,

Based on the quoted demo example I have attached a small sample project that runs as expected on my side. Please give it a try and let me know what your findings are.

Regards,
Martin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mac P
Top achievements
Rank 1
answered on 31 Mar 2010, 02:05 AM
I did convert the code to vs2010 project and it worked with validation.
However i  have one issue

 I am trying to make it work with RadGrid's EnableViewState = "False"
I have set the usercontrol's textbox ViewStateMode = "Enabled" but when i postback i dont get the modified values and for insert the textbox always returns null so validator keeps on firing.

Any help is appreciated since the viewstate is very huge and i get lot of performance gain if i disabled the viewstate.

Also in my scenario i have a grid in usercontrol and inside the grid i call another user control. do you think that will be an issue?

Regards
Mac
0
Martin
Telerik team
answered on 02 Apr 2010, 01:58 PM
Hello Mac,

I am afraid that RadGrid does not manage the state of custom edit forms (User control & Form template) when its EnableViewState property is set to "false". For more details you can check the following help article:

Optimizing ViewState usage

I hope this helps,
Martin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Mac P
Top achievements
Rank 1
Answers by
Martin
Telerik team
Mac P
Top achievements
Rank 1
Share this question
or