Suppress IDataErrorInfo validation in GridView

9 posts, 0 answers
  1. Victor
    Victor avatar
    2 posts
    Member since:
    Oct 2012

    Posted 25 Oct 2012 Link to this post

    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
  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 30 Oct 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Victor
    Victor avatar
    2 posts
    Member since:
    Oct 2012

    Posted 31 Oct 2012 Link to this post

    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
  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 01 Nov 2012 Link to this post

    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.

  6. Milan
    Milan avatar
    3 posts
    Member since:
    Aug 2010

    Posted 24 Aug 2015 Link to this post

    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

  7. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 27 Aug 2015 Link to this post

    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
  8. Milan
    Milan avatar
    3 posts
    Member since:
    Aug 2010

    Posted 27 Aug 2015 in reply to Yoan Link to this post

    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

  9. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 27 Aug 2015 Link to this post

    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
  10. Milan
    Milan avatar
    3 posts
    Member since:
    Aug 2010

    Posted 08 Sep 2015 Link to this post

    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

Back to Top
UI for WPF is Visual Studio 2017 Ready