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

Force Validation When Saving

1 Answer 251 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Travis Parks
Top achievements
Rank 1
Travis Parks asked on 28 Jan 2011, 11:06 PM
Hello:

Our controls do not validate until after the user tabs off, which is the default for binding (OnValidating). However, in the case where the use clicks a save button, validation is taking place after the save event fires. This leads to situations where the changes aren't saved and the user closes the form, losing their changes.

In Windows Forms, you could call ValidateChildren to force the controls to bind to the underlying data object. This doesn't appear to work with Telerik controls.

Is there a way to force changes to commit to the data object before the save takes place? I don't want to change the binding DataSourceUpdateMode to OnPropertyChanged.

Thanks,
Travis Parks

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 03 Feb 2011, 10:55 AM
Hello Travis Parks,

Thank you for writing.

Can you please provide more details for your case - which controls do not validate before the click event of the button? In my test with RadTextBox and RadButton when I edit the text box and click the button the first fired event is the Validating event of the text box and then comes the Click event from the button. 

As to the ValidateChildren method, we do have such a method in our RadForm, which causes validation on all controls placed on the form. So this is another way of ensuring that your control will be validated.

I am looking forward to the details regarding the non-validating controls.
 
Best wishes,
Stefan
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Tags
General Discussions
Asked by
Travis Parks
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or