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

Validation of a form

2 Answers 260 Views
Form
This is a migrated thread and some comments may be shown as answers.
Kris Anderson
Top achievements
Rank 1
Kris Anderson asked on 27 Nov 2006, 12:40 AM
Hi. I'm starting to build a Windows forms app using telerik components and wondered how you can validate a form. I've noticed the "causesValidation" property but wasn't sure if it's similar to the way ASP.NET pages are validated, using the Page.IsValid() function call. I didn't see any validation controls and wondered what the best-practices are for validation of a Win form.

By the way, I'm extremely impressed by the r.a.d. controls for WinForms. They're powerful, functional, and very aesthetically pleasing. Thank you :)

2 Answers, 1 is accepted

Sort by
0
Chris
Telerik team
answered on 27 Nov 2006, 10:42 AM
Hi Alex,
First, thanks for the nice words.
You can take a look at the following article and see how you could validate controls in WinForms. Basically you should use the controls' Validating and Validated events. You could also use an ErrorProvider component to display warnings about controls which are not validated. Currently all r.a.d.controls support the Validating and Validated events and also have the CausesValidation property which determines whether the control should fire the validation events of each control on the form. We intend to release a hotfix this week in which we'll introduce validation on item level. For example clicking on a TabStrip item won't change the selected tab item if some of the controls on the form were not properly validated.

Regards,
Chris
the telerik team
0
Kris Anderson
Top achievements
Rank 1
answered on 27 Nov 2006, 12:56 PM
Thanks, Chris. Your help is much appreciated.
Tags
Form
Asked by
Kris Anderson
Top achievements
Rank 1
Answers by
Chris
Telerik team
Kris Anderson
Top achievements
Rank 1
Share this question
or