Class RadValidationProvider
Provides a validation management for RadEditorControl descendant editors.
Inheritance
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Editors")]
public class RadValidationProvider : Component, ISupportInitialize, IExtenderProvider
Constructors
RadValidationProvider()
Initializes a new instance of the RadValidationProvider class.
Declaration
public RadValidationProvider()
RadValidationProvider(IContainer)
Initializes a new instance of the RadValidationProvider class with the specified container control.
Declaration
public RadValidationProvider(IContainer container)
Parameters
System.ComponentModel.IContainer
container
An object that implements the System.ComponentModel.IContainer interface, and owns the created object. |
Properties
AssociatedControls
Gets the collection of the controls whose values are validated.
Declaration
public List<RadEditorControl> AssociatedControls { get; }
Property Value
System.Collections.Generic.List<RadEditorControl>
|
ValidationMode
Gets or Sets the ValidationMode.
Declaration
public ValidationMode ValidationMode { get; set; }
Property Value
ValidationMode
|
ValidationRules
Gets or Sets the collection of ValidationRules that belongs to this RadValidationProvider.
Declaration
public FilterDescriptorCollection ValidationRules { get; set; }
Property Value
FilterDescriptorCollection
|
Methods
BeginInit()
Declaration
public void BeginInit()
CanExtend(Object)
Indicates whether a control can be extended.
Declaration
public bool CanExtend(object extendee)
Parameters
System.Object
extendee
The control to be extended. |
Returns
System.Boolean
true if the control can be extended otherwise false. |
ClearErrorStatus()
Clear the visual indication for the validation error.
Declaration
public virtual void ClearErrorStatus()
ClearErrorStatus(RadControl)
Clear the visual indication for the validation error.
Declaration
public virtual void ClearErrorStatus(RadControl associatedControl)
Parameters
RadControl
associatedControl
A RadEditorControl descendant |
EndInit()
Declaration
public void EndInit()
FireValidationEvent(Boolean, RadControl, IRadValidationRule)
Declaration
protected virtual RadValidationEventArgs FireValidationEvent(bool isNotValid, RadControl associatedControl, IRadValidationRule rule)
Parameters
System.Boolean
isNotValid
|
RadControl
associatedControl
|
IRadValidationRule
rule
|
Returns
RadValidationEventArgs
|
GetIconAlignment(RadEditorControl)
Get the alignment of an error icon for the specified RadEditorControl.
Declaration
public ErrorIconAlignment GetIconAlignment(RadEditorControl control)
Parameters
RadEditorControl
control
A target control. |
Returns
System.Windows.Forms.ErrorIconAlignment
An System.Windows.Forms.ErrorIconAlignment value. |
GetIconPadding(RadEditorControl)
Returns the amount of extra space to leave next to the error icon.
Declaration
public Padding GetIconPadding(RadEditorControl control)
Parameters
RadEditorControl
control
The control to get the padding for. |
Returns
System.Windows.Forms.Padding
The padding to leave between the icon and the control. |
GetValidationRule(RadEditorControl)
Returns a validation rule associated with the specified RadEditorControl descendant.
Declaration
public FilterDescriptor GetValidationRule(RadEditorControl control)
Parameters
RadEditorControl
control
A RadEditorControl descendant. |
Returns
FilterDescriptor
A RadValidationRule descendant that represents the validation rule associated with the editor. Null if no validation rule is associated with the specified control. |
OnControlValidation(RadValidationEventArgs)
Declaration
protected virtual void OnControlValidation(RadValidationEventArgs e)
Parameters
RadValidationEventArgs
e
|
RemoveControlFromRules(RadEditorControl)
Remove a specific RadEditorControl from the validation rules.
Declaration
public void RemoveControlFromRules(RadEditorControl editorControl)
Parameters
RadEditorControl
editorControl
A RadEditorControl descendant. |
RemoveRules(RadEditorControl)
Removes a rules associated with the control.
Declaration
public void RemoveRules(RadEditorControl control)
Parameters
RadEditorControl
control
A RadEditorControl descendant |
RemoveValidationRule(RadEditorControl, IRadValidationRule)
Remove a validation rule associated with the specified RadEditorControl descendant.
Declaration
public void RemoveValidationRule(RadEditorControl editorControl, IRadValidationRule ruleToRemove)
Parameters
RadEditorControl
editorControl
A RadEditorControl descendant. |
IRadValidationRule
ruleToRemove
Rule to remove. |
SetIconAlignment(RadEditorControl, ErrorIconAlignment)
Sets the alignment of an error icon for the specified control.
Declaration
public void SetIconAlignment(RadEditorControl control, ErrorIconAlignment errorIconAlignment)
Parameters
RadEditorControl
control
A target RadEditorControl. |
System.Windows.Forms.ErrorIconAlignment
errorIconAlignment
An System.Windows.Forms.ErrorIconAlignment value that specifies the alignment to be set for the RadEditorControl. |
SetIconPadding(RadEditorControl, Padding)
Sets the amount of extra space to leave between the specified control and the error icon.
Declaration
public void SetIconPadding(RadEditorControl control, Padding errorIconPadding)
Parameters
RadEditorControl
control
The |
System.Windows.Forms.Padding
errorIconPadding
The padding to add between the icon and the |
SetValidationRule(RadEditorControl, FilterDescriptor)
Associates a validation rule with the specified RadEditorControl descendant.
Declaration
public void SetValidationRule(RadEditorControl control, FilterDescriptor rule)
Parameters
RadEditorControl
control
A RadEditorControl descendant that represents the editor. |
FilterDescriptor
rule
A RadValidationRule descendant that represents the validation rule. |
ShowToolTip(RadControl, String, String, Int32, Int32, Int32, Boolean)
Declaration
protected virtual void ShowToolTip(RadControl associatedControl, string toolTipText, string toolTipTitle, int toolTipX, int toolTipY, int toolTipDuration, bool enableToolTipShadow)
Parameters
RadControl
associatedControl
|
System.String
toolTipText
|
System.String
toolTipTitle
|
System.Int32
toolTipX
|
System.Int32
toolTipY
|
System.Int32
toolTipDuration
|
System.Boolean
enableToolTipShadow
|
Validate(RadEditorControl)
Validates the specified editor associated with the RadEditorControl.
Declaration
public bool Validate(RadEditorControl control)
Parameters
RadEditorControl
control
A RadEditorControl or descendant that represents the editor to be validated. |
Returns
System.Boolean
true if the editor has been successfully validated; otherwise false. |
Events
ControlValidation
Occurs before a RadEditorControl is being validated.
Declaration
public event RadValidationEventHandler ControlValidation
Event Type
RadValidationEventHandler
|
ValidationModeChanged
Occurs when the ValidionMode property changed.
Declaration
public event EventHandler ValidationModeChanged
Event Type
System.EventHandler
|