How do I show the user entered in invalid data into a Telerik.WinControls.UI.RadTextBoxElement and other rad controls. It appears I can't use an ErrorProvider because the controls don't inherit from Windows.Forms.Control
1 Answer, 1 is accepted
0
Boyko Markov
Telerik team
answered on 21 Feb 2007, 08:35 AM
Hello Todd,
The ErrorProvider component uses a method named SetError to set an error to a control. SetError's parameters are of type control and string. Our controls are build as an aggregation of RadElements i.e RadTextBoxElement is only a part of the RadTextBox control. To use the ErrorProvider component you will have to put an instance of RadTextBox as a parameter of the SetError method instead of RadTextBoxElement because only RadTextBox inherits from System.Windows.Forms.Control. You can do the following to show the user entered an invalid data into a RadTextBox:
1) Drag&Drop a new instance of RadTextBox
2) Drag&Drop a new ErrorProvider component
3) Set error to the error provider
To set an error to the error provider you can write: