Event when a form's validation status changes?

4 posts, 0 answers
  1. Jeff
    Jeff avatar
    100 posts
    Member since:
    Apr 2008

    Posted 19 Aug Link to this post

    I have a RadDataForm, and need to be informed when the form's validation status changes.

    What I thought I could do was to listen to RadDataForm.ValidationSummary.Errors.CollectionChanged, but unfortunately, even as late as RadDataForm.Loaded, RadDataForm.ValidationSummary is null.

    Is there some event that RadDataForm fires when its validation status changes?

    Or some event that RadDataForm fires after its ValidationSummary has been created?

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 23 Aug Link to this post

    Hello Jeff,

    There is no such event introduced that you can handle. Subscribing to the CollectionChanged of the Errors collection seems applicable and I have successfully subscribed to it in the Loaded event of the RadDataForm. Please check the attached sample.  Please share more details regarding your setup so I can advise you as I am not able to reproduce such behavior. How is the validation set at your end? Can you provide a sample?

    Regards,
    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jeff
    Jeff avatar
    100 posts
    Member since:
    Apr 2008

    Posted 23 Aug in reply to Stefan Nenchev Link to this post

    I put handlers on pretty much every event, to see when the ValidationSummary first appears. It was null in Loaded, and most of the others.

    The first event in which it was not null was in GotFocus, so I'm setting up a handler on Errors.CollectionChanged in the GotFocus handler. It's not ideal, but it solves my problem.

     

  5. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 24 Aug Link to this post

    Hello Jeff,

    I am not sure of your exact setup, but in the sample provided attaching to the CollectionChanged in the Loaded event works as expected. However, I am glad to hear that you have managed to find a solution.

    Regards,
    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top