# IValidation

URL: https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.ivalidation

Version: 4.1
Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.1.0.0)

Provides access to the validation events and properties property for controls that support validation.

- C# - VB.NET

```csharp
public interface IValidation
```

```visual
Public Interface IValidation
```

Using [IValidation](/api/wisej.web/interfaces/wisej.web.ivalidation) allows developers to use uniform code to access the validation-related properties and events used by the control.

```csharp
// Old code
if (control is TextBox)
((TextBox)control).InvalidMessage = "Required";
else if (control is ComboBox)
((ComboBox)control).InvalidMessage = "Required";
// etc...

// New code
if (control is IValidation)
((IValidation)control).InvalidMessage = "Required";
```

## Properties

### ![Instance member](/img/api/instance.png) InvalidMessage

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets the invalid message that is shown in the invalid tooltip.

## Events

### ![Instance member](/img/api/instance.png) Validated

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the control is finished validating.

### ![Instance member](/img/api/instance.png) Validating

[CancelEventHandler](https://docs.microsoft.com/dotnet/api/system.componentmodel.canceleventhandler) Fired when the control is validating.

## Implemented By

| Name | Description | [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox) | Represents a check box control. | CheckedListBox | Displays aListBox in which a check box is displayed to the left of each item. | ComboBox | Represents a combo box control. | [DateTimePicker](/api/wisej.web/editors/wisej.web.datetimepicker) | Represents a control that allows the user to select or type a date and a time. | DomainUpDown | Represents a spinner control that displays string values. | ListBox | Represents a control to display a list of items. | ListControl | Provides a common implementation of members for theListBox andComboBox classes. | MaskedTextBox | Uses a mask to distinguish between proper and improper user input. | [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) | Represents a spinner control that displays numeric values. | [RadioButton](/api/wisej.web/buttons/wisej.web.radiobutton) | Enables the user to select a single option from a group of choices when paired with other [RadioButton](/api/wisej.web/buttons/wisej.web.radiobutton) controls. | [TextBox](/api/wisej.web/editors/wisej.web.textbox) | Represents a text box control that allows the user to enter any value. | [TextBoxBase](/api/wisej.web/editors/wisej.web.textboxbase) | Implements the basic functionality required by text controls. | [UpDownBase](/api/wisej.web/editors/wisej.web.updownbase) | Implements the basic functionality required by a spin box (also known as an up-down control). | [DataGridViewComboBoxEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcomboboxeditingcontrol) | Represents aComboBox control that can be hosted in a [DataGridViewComboBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcomboboxcell) . | [DataGridViewDateTimePickerEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdatetimepickereditingcontrol) | Represents a [DateTimePicker](/api/wisej.web/editors/wisej.web.datetimepicker) control that can be hosted in a [DataGridViewDateTimePickerCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewdatetimepickercell) . | [DataGridViewMaskedTextBoxEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewmaskedtextboxeditingcontrol) | Represents aMaskedTextBox control that can be hosted in a [DataGridViewMaskedTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewmaskedtextboxcell) cell. | [DataGridViewNumericUpDownEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewnumericupdowneditingcontrol) | Represents a [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) control that can be hosted in a [DataGridViewNumericUpDownCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewnumericupdowncell) . | [DataGridViewTextBoxEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxeditingcontrol) | Represents a [TextBox](/api/wisej.web/editors/wisej.web.textbox) control that can be hosted in a [DataGridViewTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell) cell when the cell's [WrapMode](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle#wrapmode) is set to [False](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtristate#fields) . | [ListViewComboBox](/api/wisej.web/lists-and-grids/wisej.web.listviewcombobox) | The TreeViewComboBox control represents a [UserComboBox](/api/wisej.web/lists-and-grids/wisej.web.usercombobox) control with aListView as the drop down panel. | TagTextBox | Represents a data field that displays a list of selectable and removable tags. The control recognizes tags as the user types and adds in front of the editable field. | TimeUpDown | Represents a spinner control that displays [TimeSpan](https://docs.microsoft.com/dotnet/api/system.timespan) values. | [TreeViewComboBox](/api/wisej.web/lists-and-grids/wisej.web.treeviewcombobox) | The TreeViewComboBox control represents a [UserComboBox](/api/wisej.web/lists-and-grids/wisej.web.usercombobox) control with aTreeView as the drop down panel. | [TypedTextBox](/api/wisej.web/editors/wisej.web.typedtextbox) | Represents a text box control that allows the user to enter a typed value. | Upload | Represent an upload widget. Allows users to selected one or more files and upload them to the server. | [UserComboBox](/api/wisej.web/lists-and-grids/wisej.web.usercombobox) | The UserComboBox control represents aComboBox control with a custom panel that drops down when the user clicks the down arrow.
