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

Grid Validation problem with hierarchyloadmode="Client"

3 Answers 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ultravelocity
Top achievements
Rank 1
Ultravelocity asked on 20 Aug 2012, 04:49 PM
We are facing some issues with validators when using the RadGrid (2011.3.1115.40) as follows:

1) The grid has two detail (child) tables
2) Since all rows in the grid are editable, each column uses ItemTemplates with input controls and various validators (server side validation only)
3) All tables are set with HierarchyLoadMode="Client"

When we press the Save button, we call Page.IsValid on the server. This works for the most part, however, we noticed that sometimes validators in detail tables are not firing. We can consistently reproduce the following behavior:

1) Load the page and grid normally
2) Expand any row. Don't enter any data
3) Press save
4) We see the validators have fired
5) Collapse that same row
6) Press save again
7) Now when we expand that same row again, we see that the validators have NOT fired

Please advise.

3 Answers, 1 is accepted

Sort by
0
Ultravelocity
Top achievements
Rank 1
answered on 30 Aug 2012, 04:39 PM
We have reproduced this bug in the latest version as well. Any ideas?
0
Vasil
Telerik team
answered on 03 Sep 2012, 01:33 PM
Hi,

Even if you are using the HierarchyLoadMode="Client", during the postback, the indexes of collapsed items are serialized to the server, so server side the item are also collapsed. If a row is collapsed the Validator will be not visible, and it's error text will be never evaluated. See this resources: Effect of Enabled, Visible, and Display Properties

Regards,
Vasil
the Telerik team
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 their blog feed now.
0
Ultravelocity
Top achievements
Rank 1
answered on 04 Sep 2012, 05:17 PM
In case anyone else encounters this issue, we worked around this by first expanding all the rows in page_load after any postback. During this expansion, we remember which items were originally collapsed. Then we just collapse those rows after validation is done (i.e., after Page.IsValid is called). This seems to do the trick.
Tags
Grid
Asked by
Ultravelocity
Top achievements
Rank 1
Answers by
Ultravelocity
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or