Class
RadValidationProvider

Provides a validation management framework for RadEditorControl descendant editors, enabling the creation and enforcement of validation rules with visual error indicators and tooltips.

Definition

Constructors

RadValidationProvider()

Initializes a new instance of the RadValidationProvider class.

Declaration

cs-api-definition
public RadValidationProvider()

RadValidationProvider(IContainer)

Initializes a new instance of the RadValidationProvider class with the specified container control.

Declaration

cs-api-definition
public RadValidationProvider(IContainer container)

Parameters

container

IContainer

An object that implements the IContainer interface, and owns the created object.

Properties

AssociatedControls

Gets a collection of all RadEditorControl instances that have validation rules associated with them.

Declaration

cs-api-definition
[Browsable(false)]
public List<RadEditorControl> AssociatedControls { get; }

Property Value

List<RadEditorControl>

ValidationMode

Gets or sets the validation mode that determines when validation should be triggered for associated controls.

Declaration

cs-api-definition
public ValidationMode ValidationMode { get; set; }

Property Value

ValidationMode

ValidationRules

Gets or sets the collection of validation rules that define the validation criteria for associated RadEditorControl instances.

Declaration

cs-api-definition
public FilterDescriptorCollection ValidationRules { get; set; }

Property Value

FilterDescriptorCollection

Methods

BeginInit()

Signals the start of initialization for the validation provider component.

Declaration

cs-api-definition
public void BeginInit()

Implements ISupportInitialize.BeginInit()

CanExtend(object)

Indicates whether a control can be extended by this provider. Specifies whether this object can provide its extender properties to the specified object.

Declaration

cs-api-definition
public bool CanExtend(object extendee)

Parameters

extendee

object

The object to be checked for extension capability.

Returns

bool

true if the object can be extended (is a RadEditorControl); otherwise false.

Implements IExtenderProvider.CanExtend(object)

ClearErrorStatus()

Clears the visual indication for validation errors on all associated controls.

Declaration

cs-api-definition
public virtual void ClearErrorStatus()

ClearErrorStatus(RadControl)

Clears the visual indication for validation errors on the specified control.

Declaration

cs-api-definition
public virtual void ClearErrorStatus(RadControl associatedControl)

Parameters

associatedControl

RadControl

A RadControl descendant for which to clear the error status.

EndInit()

Signals the end of initialization for the validation provider component and ensures proper event subscription.

Declaration

cs-api-definition
public void EndInit()

Implements ISupportInitialize.EndInit()

FireValidationEvent(bool, RadControl, IRadValidationRule)

Creates and fires a validation event with the specified parameters and returns the configured event arguments.

Declaration

cs-api-definition
protected virtual RadValidationEventArgs FireValidationEvent(bool isNotValid, RadControl associatedControl, IRadValidationRule rule)

Parameters

isNotValid

bool

true if validation has failed; otherwise false.

associatedControl

RadControl

The RadControl being validated.

rule

IRadValidationRule

The IRadValidationRule that was evaluated.

Returns

RadValidationEventArgs

A configured RadValidationEventArgs object containing validation results and settings.

GetIconAlignment(RadEditorControl)

Gets the alignment of the error icon for the specified RadEditorControl.

Declaration

cs-api-definition
public ErrorIconAlignment GetIconAlignment(RadEditorControl control)

Parameters

control

RadEditorControl

A target RadEditorControl for which to retrieve the icon alignment.

Returns

ErrorIconAlignment

An ErrorIconAlignment value representing the current alignment setting for the control.

GetIconPadding(RadEditorControl)

Returns the amount of extra space to leave next to the error icon for the specified control.

Declaration

cs-api-definition
public Padding GetIconPadding(RadEditorControl control)

Parameters

control

RadEditorControl

The RadEditorControl to get the padding for.

Returns

Padding

The padding to leave between the icon and the control.

GetValidationRule(RadEditorControl)

Returns the first validation rule associated with the specified RadEditorControl descendant.

Declaration

cs-api-definition
public FilterDescriptor GetValidationRule(RadEditorControl control)

Parameters

control

RadEditorControl

A RadEditorControl descendant for which to retrieve the validation rule.

Returns

FilterDescriptor

An IRadValidationRule that represents the validation rule associated with the editor, or null if no validation rule is associated with the specified control.

OnControlValidation(RadValidationEventArgs)

Raises the ControlValidation event with the specified validation event arguments.

Declaration

cs-api-definition
protected virtual void OnControlValidation(RadValidationEventArgs e)

Parameters

e

RadValidationEventArgs

A RadValidationEventArgs that contains the event data.

RemoveControlFromRules(RadEditorControl)

Removes a specific RadEditorControl from all validation rules in the provider.

Declaration

cs-api-definition
public void RemoveControlFromRules(RadEditorControl editorControl)

Parameters

editorControl

RadEditorControl

A RadEditorControl descendant to remove from all validation rules.

RemoveRules(RadEditorControl)

Removes all validation rules associated with the specified RadEditorControl.

Declaration

cs-api-definition
public void RemoveRules(RadEditorControl control)

Parameters

control

RadEditorControl

A RadEditorControl descendant for which to remove all associated rules.

RemoveValidationRule(RadEditorControl, IRadValidationRule)

Removes a specific validation rule association with the specified RadEditorControl descendant.

Declaration

cs-api-definition
public void RemoveValidationRule(RadEditorControl editorControl, IRadValidationRule ruleToRemove)

Parameters

editorControl

RadEditorControl

A RadEditorControl descendant to remove from the rule.

ruleToRemove

IRadValidationRule

The validation rule to disassociate from the control.

SetIconAlignment(RadEditorControl, ErrorIconAlignment)

Sets the alignment of the error icon for the specified RadEditorControl.

Declaration

cs-api-definition
public void SetIconAlignment(RadEditorControl control, ErrorIconAlignment errorIconAlignment)

Parameters

control

RadEditorControl

A target RadEditorControl for which to set the icon alignment.

errorIconAlignment

ErrorIconAlignment

An ErrorIconAlignment value that specifies the alignment to be set for the control.

SetIconPadding(RadEditorControl, Padding)

Sets the amount of extra space to leave between the specified control and the error icon.

Declaration

cs-api-definition
public void SetIconPadding(RadEditorControl control, Padding errorIconPadding)

Parameters

control

RadEditorControl

The RadEditorControl to set the padding for.

errorIconPadding

Padding

The padding to add between the icon and the control.

SetValidationRule(RadEditorControl, FilterDescriptor)

Associates a validation rule with the specified RadEditorControl descendant.

Declaration

cs-api-definition
public void SetValidationRule(RadEditorControl control, FilterDescriptor rule)

Parameters

control

RadEditorControl

A RadEditorControl descendant that represents the editor.

rule

FilterDescriptor

An IRadValidationRule that represents the validation rule to associate.

ShowToolTip(RadControl, string, string, int, int, int, bool)

Shows a custom tooltip for validation errors with the specified parameters and styling.

Declaration

cs-api-definition
protected virtual void ShowToolTip(RadControl associatedControl, string toolTipText, string toolTipTitle, int toolTipX, int toolTipY, int toolTipDuration, bool enableToolTipShadow)

Parameters

associatedControl

RadControl

The RadControl to display the tooltip on.

toolTipText

string

The text content of the tooltip.

toolTipTitle

string

The title text of the tooltip.

toolTipX

int

The X coordinate position for the tooltip.

toolTipY

int

The Y coordinate position for the tooltip.

toolTipDuration

int

The duration in milliseconds to display the tooltip.

enableToolTipShadow

bool

true to enable shadow effect on the tooltip; otherwise false.

Validate(RadEditorControl)

Validates the specified editor control against all associated validation rules.

Declaration

cs-api-definition
public bool Validate(RadEditorControl control)

Parameters

control

RadEditorControl

A RadEditorControl or descendant that represents the editor to be validated.

Returns

bool

true if the editor has been successfully validated against all rules; otherwise false.

Events

ControlValidation

Occurs before a RadEditorControl is being validated, allowing custom validation logic and error handling.

Declaration

cs-api-definition
public event RadValidationEventHandler ControlValidation

Event Value

RadValidationEventHandler

ValidationModeChanged

Occurs when the ValidationMode property has changed, notifying subscribers of the validation timing change.

Declaration

cs-api-definition
public event EventHandler ValidationModeChanged

Event Value

EventHandler