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

Suppress IDataErrorInfo validation in GridView

8 Answers 317 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 25 Oct 2012, 03:46 PM
Hi,

In my application data entities implement both INotifyDataErrorInfo and IDataErrorInfo interfaces. When I bind these entities to the GridView control and perform validation I get each error listed twice in the error tooltip. I believe it happens in GridViewBoundColumnBase.GetDataErrorValidationErrors() method which collects errors using both interfaces mentioned above.

Can I somehow disable validation via IDataErrorInfo interface?

It's WPF application, .NET 4.5, Telerik contols version 2012.3.1017.45

Thanks,
Victor

8 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 30 Oct 2012, 03:56 PM
Hello Victor,

 
Unfortunately, there is no way to disable validation only of IDataErrorInfo interface. The possible approach is to set the GridView's property ValidatesOnDataErrors to None, but in this way GridView will remove both listed errors. So, I suggest you to use only INotifyDataErrorInfo, considering it has some benefits than IDataErrorInfo.


All the best,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Victor
Top achievements
Rank 1
answered on 31 Oct 2012, 10:04 AM
Hi Yoan,

I wish I could use INotifyDataErrorInfo only but unfortunately I can't as the entities code is generated by the ORM tool.

Do you plan to separate control over validation using INotifyDataErrorInfo and IDataErrorInfo in future releases? Like adding separate properties ValidatesOnDataErrors and NotifiesOnDataErrors or something? If you do I can live with the duplicate errors for now (or remove the duplicates manually if possible).

Regards,
Victor
0
Yoan
Telerik team
answered on 01 Nov 2012, 04:45 PM
Hello Victor,

As it turns out, for now we do not plan to add separate control over validation using INotifyDataErrorInfo and IDataErrorInfo, but this feature might be of interest to other customers as well. Therefore, I have logged this feature request in our Public Issue Tracking System so other people can vote for it. If it gets more votes, we will consider scheduling it for a future release. Here is the link to the PITS entry.

Greetings,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Milan
Top achievements
Rank 1
answered on 24 Aug 2015, 03:26 PM

Hello Yoan,

Currently, I have ran into the same issue as Victor, but your link to the PITS entry no longer works. How is the status of this request?

Also, I found that additionally to the INotifyDataErrorInfo and IDataErrorInfo errors, RadGridView also checks for System.ComponentModel.DataAnnotantions attributes, which I also use in my scenario. So, in my scenario, I actually get triple validation errors.

Regards,
Milan

0
Yoan
Telerik team
answered on 27 Aug 2015, 07:50 AM
Hi,

Actually, with the current version RadGridView does not allow the same errors to appear multiple times (from IDataErrorInfo and INotifyDataErrorInfo). I have attached a sample project where you can observe this behavior. Generally, you can decide which one of the validation approaches to use.

Regards,
Yoan
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Milan
Top achievements
Rank 1
answered on 27 Aug 2015, 09:26 AM

Hi Yoan,

 

If this was true (RadGridView only showing one error, and not both IDataErrorInfo and INotifyDataErrorInfo) without any additional settings, that would be perfect. But I just now tried with your sample project, and it still shows all 3. I tried with "Telerik UI for WPF Q2 2015 SP1".

I have upgraded your original test project to .NET 4.5 and fixed it, and would like send it back to you, how do I do that? 

Regards,

Milan

0
Ivan Ivanov
Telerik team
answered on 27 Aug 2015, 03:29 PM
Hello,

Can you please send us the updated project through a support ticket, so that we can be sure that we are on the same page? Tickets can have up to 20 MB zip attachments are enable 24 hours priority support.

Regards,
Ivan Ivanov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Milan
Top achievements
Rank 1
answered on 08 Sep 2015, 11:29 AM

For reference, I am linking related information:

Support ticket: 965824, "GridView shows errors from multiple validation interfaces at the same time "

Public feedback entry: http://feedback.telerik.com/Project/143/Feedback/Details/168483-validationmodes-property-that-indicates-what-type-of-validation-input-should-be-p

Tags
GridView
Asked by
Victor
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Victor
Top achievements
Rank 1
Milan
Top achievements
Rank 1
Ivan Ivanov
Telerik team
Share this question
or