radvalidationprovider

1 Answer 42 Views
ValidationProvider
Henry
Top achievements
Rank 1
Henry asked on 13 Jun 2021, 11:32 AM

Is it possible to add your own operators to the list of valid radvalidatorprovider's own operators.   I have a requirement for two operators:

 

1.  See if a value is already contained with a Dictionary object, if so the operator should cause the validation to fail.

2. See if a folder path specified in a textboxcontrol exists on dick.  If not, then the validation should fail.

 

I know I could do this in code, and simply display a dialog stating the error, but I want consistent validation reporting throughout my application.

1 Answer, 1 is accepted

Sort by
0
Nadya
Telerik team
answered on 16 Jun 2021, 08:52 AM

Hello, Henry,

RadValidationRule offers a set of predefined operators used for the validation logic. You can find the available operators listed here. It is not possible to define custom operators.

I would like to note that RadValidationProvider offers the ControlValidation event. The ControlValidation event is specifically designed to handle cases in which the validation logic may not be easily defined with validation rules. It gives you the possibility to provide conditional validation and control the situations in which the control being validated has correct content. The IsValid property indicates the result from the rule evaluation. Thus, in the event, you can override whether the control's value is valid or not.  Additional information about the public API that RadValidationProvider offers is available here: https://docs.telerik.com/devtools/winforms/controls/validation-provider/validation-rules 

I hope this information helps. If you have further questions please let me know. 

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ValidationProvider
Asked by
Henry
Top achievements
Rank 1
Answers by
Nadya
Telerik team
Share this question
or