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

GridView.ValidationSummary.HasErrors?

3 Answers 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 01 May 2011, 01:02 PM
Is there not a highlevel property that indicates if the condition of the grid has validation errors similar to

GridView.ValidationSummary.HasErrors?

Or is it necessary to do some type of iteration row by row?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 02 May 2011, 07:02 AM
Hi Mark,

Basically, you may handle the CellValidating/CellValidated/RowValidating or RowValidated events of the grid to verify whether there are any errors. Still, you may run through our online documentation for additional reference on the possible ways for handling the validation in RadGridView.  

Regards,
Maya
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
Mark
Top achievements
Rank 1
answered on 02 May 2011, 10:27 AM
Hi Maya,

Thank you for confirming that there is no such indication on the grid.  This really would be something useful to have instead of needing to drill down to a row or cell.  Again it isn't a question of "how to" handle the events or validation, it is a status of the grid from higher abstraction.

The documentation doesn't have any reference to such in respect to the grid.

Mark
0
Maya
Telerik team
answered on 03 May 2011, 07:37 AM
Hello Mark,

RadGridView does take care of the validation, but only for the items in the view port. Consequently, it is not appropriate to have a general abstract property defining the presence of all validation errors. 
However, depending on your particular scenario, you may implement a couple of possible approaches. 
Firstly, you may implement INotifyDataErrorInfo/ IDataErorInfo Interfaces that will ensure asynchronous data validation. Afterwards, as you are the one to know when a particular item has failed validation, you may set the appropriate style for the corresponding row.
Yet another approach would be to call the ScrollIntoView()/ScrollIntoViewAsync() method, once an invalid item comes. However, in this case you may result in scrolling up and down a bunch of times depending on the number and place of the invalid items. 
  

All the best,
Maya
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
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Maya
Telerik team
Mark
Top achievements
Rank 1
Share this question
or