Validation
Wisej.Web.Validation
Last updated
Was this helpful?
Wisej.Web.Validation
Last updated
Was this helpful?
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.5.0.0)
Adds a common validation system to any Control.
You can drop this extender on any design surface to add validation rules to any control at design time using the added ValidationRules property. You can also use this component at runtime and invoke the SetValidationRules method directly. Validation rules are executed in the order they are added to the array. When a validation rule fails validation, the next rules are NOT executed and the Cancel property of the control's event is set to true.
Initializes a new instance of the Validation class.
Initializes a new instance of the Validation class attached to a IContainer implementation.
container
ContainerControl: Returns or sets the container ContainerControlthat provides the BindingContext for binding to the IDataErrorInfo interface implemented by a DataSource. (Default: null
)
String: Returns or sets the list within a data source to monitor for errors. (Default: ""
)
Object: Returns or sets the data source that the Validation extender monitors for errors. (Default: null
)
IErrorProvider: Associates an IErrorProvider to the Validation extender."/> (Default: null
)
Object: Returns or sets the object that contains programmer-supplied data associated with the Validation extender. (Default: null
)
Sets the DataSource and DataMember properties.
dataSource
dataMember
A collection within the dataSource to monitor for errors.
Returns a value indicating whether a control can be extended.
extendee
The control to be extended.
Returns: Boolean. true if the control can be extended; otherwise, false.
Removes all validation rules.
Returns the collection of ValidationRule associated with the specified control .
control
Control associated with the validation rules to retrieve.
Returns: ValidationRule[]. Array of the validation rules associated to the control .
Fires the Validated event.
e
Fires the Validating event.
e
Removes all the validation rules from the control .
control
Sets the list of validation rules associated with the specified control .
control
Control associated with the validation rules.
rules
List of validation rules to enforce on the specified control .
Updated the bindings.
ValidationEventHandler Fired after any control associated to the Validation extender has been successfully validated.
You can add an handler to this event and handle the successful validation of all the controls that have a set of validation rules in one place.
ValidationEventHandler Fired when the any control associated to the Validation extender is being validated.
You can add an handler to this event and handle the validation of all the controls that have a set of validation rules in one place.
An that represents the container of the extender.
When this property is null (default), the validation extender sets the property of the control being validated to the corresponding when a validation rule fails. Otherwise it invokes the method passing the control that failed validation and the corresponding string. You may use an instance of ErrorProvider to display error icons and messages. But you can also implement the IErrorProvider interface in a custom class and manage errors however required by the application. A third option is to assign a Label (or any Control that implements IErrorProvider) to the property to let the validation extender set the text property to the corresponding string.
The Label (or any Control that implements IErrorProvider) is automatically hidden ( is set to false) when there is no error message to display.
A data set based on the interface to be monitored for errors.
Control to remove from the extender.