# ErrorProvider

Namespace: **Wisej.Web**

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

* [Component](https://docs.wisej.com/api/v2.5/wisej.base/general/wisej.base.component)
  * [Component](https://docs.wisej.com/api/v2.5/wisej.web/general/wisej.web.component)
    * [ErrorProvider](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider)

Provides a user interface for indicating that a control on a form has an error associated with it.

{% tabs %}
{% tab title="C#" %}

```csharp
public class ErrorProvider : Component, IExtenderProvider, ISupportInitialize
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class ErrorProvider
    Inherits Component
    Implements IExtenderProvider, ISupportInitialize
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)ErrorProvider()

Initializes a new instance of the [ErrorProvider](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider) class and initializes the default settings for [BlinkRate](#blinkrate), [BlinkStyle](#blinkstyle), and the [Icon](#icon).

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)ErrorProvider(containerControl)

Initializes a new instance of the [ErrorProvider](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider) class attached to a [ContainerControl](https://docs.wisej.com/api/v2.5/wisej.web/containers/containercontrol).

| Name                 | Type                                                                                      | Description                                                                                                          |
| -------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **containerControl** | [ContainerControl](https://docs.wisej.com/api/v2.5/wisej.web/containers/containercontrol) | The [ContainerControl](https://docs.wisej.com/api/v2.5/wisej.web/containers/containercontrol) to monitor for errors. |

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)ErrorProvider(container)

Initializes a new instance of the [ErrorProvider](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider) class attached to an [IContainer](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.icontainer) implementation.

| Name          | Type                                                                                       | Description                                                                                                                                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **container** | [IContainer](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.icontainer) | An [IContainer](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.icontainer) that represents the container of the [ErrorProvider](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider) extender. |

## Properties

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)AllowHtml

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets a value indicating that the control can display HTML in the ErrorMessage property.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)BlinkAnimation

[ErrorAnimationType](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.erroranimationtype): Returns or sets a value indicating the type of animation to perform when the error icon blinks..

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)BlinkRate

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): Returns or sets the rate at which the error icon flashes.

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentoutofrangeexception) The value is less than zero.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)BlinkStyle

[ErrorBlinkStyle](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorblinkstyle): Returns or sets a value indicating when the error icon flashes.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)ContainerControl

[ContainerControl](https://docs.wisej.com/api/v2.5/wisej.web/containers/containercontrol): Returns or sets the parent control for this [ErrorProvider](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider).

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)DataMember

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the list within a data source to monitor for errors.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)DataSource

[Object](https://docs.microsoft.com/en-us/dotnet/api/system.object): Returns or sets the data source that the [ErrorProvider](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider) monitors for errors.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)HasErrors

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns true when the error provider contains at least one error.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)Icon

[Image](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image): Returns or sets the [Image](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image) that is displayed next to a control when an error description string has been set for the control.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) The assigned value of the [Image](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image) is null.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)IconAlignment

[ErrorIconAlignment](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.erroriconalignment): Returns or sets the default [ErrorIconAlignment](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.erroriconalignment).

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)IconPadding

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): Returns or sets the default [ErrorIconAlignment](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.erroriconalignment).

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)IconSource

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the source URL of the image that is displayed next to a control when an error description string has been set for the control.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) The assigned value of the [Image](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image) is null.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)RightToLeft

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets a value that indicates whether the component is used in a locale that supports right-to-left fonts.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)Tag

[Object](https://docs.microsoft.com/en-us/dotnet/api/system.object): Returns or sets an object that contains data about the component.

## Methods

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)BindToDataAndErrors(dataSource, dataMember)

Sets the [DataSource](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider) and [DataMember](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.errorprovider) properties.

| Parameter      | Type                                                                | Description                                                                                                                                 |
| -------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **dataSource** | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | A data set based on the [IList](https://docs.microsoft.com/en-us/dotnet/api/system.collections.ilist) interface to be monitored for errors. |
| **dataMember** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) | A collection within the *dataSource* to monitor for errors.                                                                                 |

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)CanExtend(extendee)

Returns a value indicating whether a control can be extended.

| Parameter    | Type                                                                | Description                 |
| ------------ | ------------------------------------------------------------------- | --------------------------- |
| **extendee** | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | The control to be extended. |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). true if the control can be extended; otherwise, false.This property will be true if the object is a [Control](https://docs.wisej.com/api/v2.5/wisej.web/general/control) and is not a [Form](https://docs.wisej.com/api/v2.5/wisej.web/containers/form) or [ToolBar](https://docs.wisej.com/api/v2.5/wisej.web/containers/toolbar).

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)Clear()

Clears all error providers.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)GetError(control)

Returns the current error description string for the specified control.

| Parameter   | Type                                                                 | Description                                       |
| ----------- | -------------------------------------------------------------------- | ------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v2.5/wisej.web/general/control) | The item to get the error description string for. |

**Returns:** [String](https://docs.microsoft.com/en-us/dotnet/api/system.string). The error description string for the specified control.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) *control* is null.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)GetIconAlignment(control)

Returns a value indicating where the error icon should be placed in relation to the control.

| Parameter   | Type                                                                 | Description                               |
| ----------- | -------------------------------------------------------------------- | ----------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v2.5/wisej.web/general/control) | The control to get the icon location for. |

**Returns:** [ErrorIconAlignment](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.erroriconalignment). One of the [ErrorIconAlignment](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.erroriconalignment) values. The default icon alignment is [MiddleRight](https://docs.wisej.com/api/v2.5/wisej.web/wisej.web.erroriconalignment#fields).

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) *control* is null.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)GetIconPadding(control)

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

| Parameter   | Type                                                                 | Description                         |
| ----------- | -------------------------------------------------------------------- | ----------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v2.5/wisej.web/general/control) | The control to get the padding for. |

**Returns:** [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32). The number of pixels to leave between the icon and the control.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) *control* is null.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)SetError(control, value)

Sets the error description string for the specified control.

| Parameter   | Type                                                                 | Description                                                                                                                            |
| ----------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v2.5/wisej.web/general/control) | The control to set the error description string for.                                                                                   |
| **value**   | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)  | The error description string, or null or [Empty](https://docs.microsoft.com/en-us/dotnet/api/system.string.empty) to remove the error. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) *control* is null.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)SetIconAlignment(control, value)

Sets the location where the error icon should be placed in relation to the control.

| Parameter   | Type                                                                                                   | Description                                                                                                               |
| ----------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v2.5/wisej.web/general/control)                                   | The control to set the icon location for.                                                                                 |
| **value**   | [ErrorIconAlignment](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.erroriconalignment) | One of the [ErrorIconAlignment](https://docs.wisej.com/api/v2.5/wisej.web/extenders/wisej.web.erroriconalignment) values. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) *control* is null.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)SetIconPadding(control, value)

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

| Parameter   | Type                                                                 | Description                                                      |
| ----------- | -------------------------------------------------------------------- | ---------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v2.5/wisej.web/general/control) | The *control* to set the padding for.                            |
| **value**   | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)    | The number of pixels to add between the icon and the *control* . |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) *control* is null.

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)UpdateBinding()

Updated the bindings.

## Events

### ![](https://314832588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTHCfAYyBPycFG90wsw-4198400543%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=060b281d-9363-48a1-a0f9-788ad1831e96)RightToLeftChanged

[EventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.eventhandler) Fired when the [RightToLeft](#righttoleft) property changes value.

## Implements

| Name                                                                                                      | Description                                    |
| --------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [IWisejComponent](https://docs.wisej.com/api/v2.5/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface. |
| [IWisejSerializable](https://docs.wisej.com/api/v2.5/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.          |
