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

Event when a form's validation status changes?

3 Answers 16 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 19 Aug 2016, 09:22 PM

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?

3 Answers, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 23 Aug 2016, 11:40 AM
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.
0
Jeff
Top achievements
Rank 1
answered on 23 Aug 2016, 02:56 PM

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.

 

0
Stefan Nenchev
Telerik team
answered on 24 Aug 2016, 08:09 AM
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.
Tags
DataForm
Asked by
Jeff
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or