Validations

4 posts, 0 answers
  1. Shruti
    Shruti avatar
    10 posts
    Member since:
    Jul 2013

    Posted 06 Sep 2013 Link to this post

    Hi,

    I wanted to know how can i validate telerik wpf controls for some customs validations in mvvm type of architecture.
    Basically i want to validate multiple controls on a button click , store the error messages of validations and display all of them in a pop-up(say sort of validation summary)

    Please suggest something
    Thanks in advance

    Shruti
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Sep 2013 Link to this post

    Hi Shruti,

     Your controls can be bound to ViewModels which implement IDataErorrInfo interface. On a ButtonClick you have to simply iterate over the ViewModels, check the Errors collection and add the existing errorrs in Dictionaly, List, etc. and later display all errors in other control. 

    Regards,
    Petar Mladenov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Shruti
    Shruti avatar
    10 posts
    Member since:
    Jul 2013

    Posted 13 Sep 2013 Link to this post

    Hi petar,
    Thanks for your reply. 
    But i had actually implemented ther IdataErrorInfo Interface. But could not understand how to access the Error Messages and store it in a list. It would be really helpful if you could provide with a demmo app.

    Thanks  a lot in advance

    Shruti
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 18 Sep 2013 Link to this post

    Hi Shruti,

     Please check out this post. Customr has Error property of type string. So in your application you will have Customer bound to TextBox, Employee bound to other control, etc. and you can have MainViewModel holding all customers and all employees and all other ViewModels (business objets implementing IDataErrorInfo) and this viewmocel can iterate on these objects and sum their error properties into a list.
    We hope this can help you proceed further.

    Regards,
    Petar Mladenov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top