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

Validation On Load

4 Answers 183 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gaurav
Top achievements
Rank 1
Gaurav asked on 15 Oct 2010, 03:54 PM
http://www.telerik.com/help/wpf/gridview-events-validation.html reads that
"It is important to know that each one of the validation events is fired only when the user is trying to commit new data in the RadGridView control. They do not occur when the RadGridView loads data."

But I need to validate when the RadGridView loads data and show validation(error) message (if any) to user.
So can we fire the validation events explicitly on data load?

If this is not possible,

Is there any other workaround to achieve this?

If there is no other work around, is it possible to validate multiple cells and show validation (error) message on some external trigger (say a button click where button is outside the Radgridview)?

4 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 15 Oct 2010, 04:55 PM
Hello Gaurav,

Please try our latest release - Q2 2010 SP2. It contains a new property - ValidatesOnDataErrors with option to set it to InViewMode or in EditMode.
Having it in Default mode will do the trick as well. Please try it and let us know the result.

All the best,
Veselin Vasilev
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
Radoslaw
Top achievements
Rank 1
answered on 07 Feb 2011, 08:26 PM
I've try InViewMode option of property ValidatesOnDataErrors of my RadGridView (Q2 2010 SP2), but after loading data in my grid, ther is no validation erros visible till I try edit grid rows.
How to use ValidatesOnDataErrors property of RadGridRow to show validation erros after loading data ?
0
Veselin Vasilev
Telerik team
answered on 10 Feb 2011, 04:42 PM
Hi Radoslaw,

Does your business object implements IDataErrorInfo or INotifyDataErrorInfo?

I have attached a sample project. The Club class implements the IDataErrorInfo and throws an error if the name is null or empty.


Best wishes,
Veselin Vasilev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Vit100
Top achievements
Rank 1
answered on 09 Nov 2011, 09:21 PM
How come that grid in attached sample highligts "bad" records?
I have similar class/VM/model - and my grid doesn't show error from the very beginning, before edit..???

Also how to achive same result if Data is coming from RIA Dataservice?
If some of the values of properties ==null and must be assigned by user before submitting changes...
Tags
GridView
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Radoslaw
Top achievements
Rank 1
Vit100
Top achievements
Rank 1
Share this question
or