# ErrorProvider

Namespace: **Wisej.Web**

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

* [Component](/api/wisej.base/general/wisej.base.component.md)
  * [Component](/api/wisej.web/general/wisej.web.component.md)
    * [ErrorProvider](/api/wisej.web/extenders/errorprovider.md)

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, IErrorProvider
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) ErrorProvider()

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

### ![](/files/hsR4ok3152WyAf8J2C1u) ErrorProvider(containerControl)

Initializes a new instance of the [ErrorProvider](/api/wisej.web/extenders/errorprovider.md) class attached to a [ContainerControl](/api/wisej.web/containers/containercontrol.md).

| Name                 | Type                                                              | Description                                                                                  |
| -------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| **containerControl** | [ContainerControl](/api/wisej.web/containers/containercontrol.md) | The [ContainerControl](/api/wisej.web/containers/containercontrol.md) to monitor for errors. |

### ![](/files/hsR4ok3152WyAf8J2C1u) ErrorProvider(container)

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

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

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) AllowHtml

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

### ![](/files/hsR4ok3152WyAf8J2C1u) BlinkAnimation

[ErrorAnimationType](/api/wisej.web/extenders/wisej.web.erroranimationtype.md): Returns or sets a value indicating the type of animation to perform when the error icon blinks.. (Default: `Blink`)

### ![](/files/hsR4ok3152WyAf8J2C1u) BlinkRate

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

**Throws:**

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

### ![](/files/hsR4ok3152WyAf8J2C1u) BlinkStyle

[ErrorBlinkStyle](/api/wisej.web/extenders/wisej.web.errorblinkstyle.md): Returns or sets a value indicating when the error icon flashes. (Default: `BlinkIfDifferentError`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ContainerControl

[ScrollableControl](/api/wisej.web/containers/scrollablecontrol.md): Returns or sets the container [ContainerControl](/api/wisej.web/containers/containercontrol.md)that provides the [BindingContext](/api/wisej.web/data-binding/wisej.web.bindingcontext.md) for binding to the [IDataErrorInfo](https://docs.microsoft.com/dotnet/api/system.componentmodel.idataerrorinfo) interface implemented by a [DataSource](#datasource). (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) DataMember

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

### ![](/files/hsR4ok3152WyAf8J2C1u) DataSource

[Object](https://docs.microsoft.com/dotnet/api/system.object): Returns or sets the data source that the [ErrorProvider](/api/wisej.web/extenders/errorprovider.md) monitors for errors. (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) HasErrors

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Icon

[Image](https://docs.microsoft.com/dotnet/api/system.drawing.image): Returns or sets the [Image](https://docs.microsoft.com/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/dotnet/api/system.argumentnullexception)\
  The assigned value of the [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) is null.

### ![](/files/hsR4ok3152WyAf8J2C1u) IconAlignment

[ErrorIconAlignment](/api/wisej.web/extenders/wisej.web.erroriconalignment.md): Returns or sets the default [ErrorIconAlignment](/api/wisej.web/extenders/wisej.web.erroriconalignment.md). (Default: `MiddleRight`)

### ![](/files/hsR4ok3152WyAf8J2C1u) IconPadding

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the default [ErrorIconAlignment](/api/wisej.web/extenders/wisej.web.erroriconalignment.md). (Default: `0`)

### ![](/files/hsR4ok3152WyAf8J2C1u) IconSource

[String](https://docs.microsoft.com/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/dotnet/api/system.argumentnullexception)\
  The assigned value of the [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) is null.

### ![](/files/hsR4ok3152WyAf8J2C1u) RightToLeft

[Boolean](https://docs.microsoft.com/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. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Tag

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

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) BindToDataAndErrors(dataSource, dataMember)

Sets the [DataSource](#datasource) and [DataMember](#datamember) properties.

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

### ![](/files/hsR4ok3152WyAf8J2C1u) CanExtend(extendee)

Returns a value indicating whether a control can be extended.

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

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Clear()

Clears all error providers.

### ![](/files/lzopMboA31bVq8UIcbT3) Dispose(disposing)

Disposes the component and removes it from the design container.

| Parameter     | Type                                                            | Description                                                                 |
| ------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. |

### ![](/files/hsR4ok3152WyAf8J2C1u) GetError(control)

Returns the current error description string for the specified control.

| Parameter   | Type                                         | Description                                       |
| ----------- | -------------------------------------------- | ------------------------------------------------- |
| **control** | [Control](/api/wisej.web/general/control.md) | The item to get the error description string for. |

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

**Throws:**

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

### ![](/files/hsR4ok3152WyAf8J2C1u) GetIconAlignment(control)

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

| Parameter   | Type                                         | Description                               |
| ----------- | -------------------------------------------- | ----------------------------------------- |
| **control** | [Control](/api/wisej.web/general/control.md) | The control to get the icon location for. |

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

**Throws:**

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

### ![](/files/hsR4ok3152WyAf8J2C1u) GetIconPadding(control)

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

| Parameter   | Type                                         | Description                         |
| ----------- | -------------------------------------------- | ----------------------------------- |
| **control** | [Control](/api/wisej.web/general/control.md) | The control to get the padding for. |

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

**Throws:**

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

### ![](/files/lzopMboA31bVq8UIcbT3) OnErrorChanged(e)

| Parameter | Type                                                                                                                         | Description |
| --------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------- |
| **e**     | [ErrorProviderErrorChangedEventArgs](/api/wisej.web/extenders/errorprovider/wisej.web.errorprovidererrorchangedeventargs.md) |             |

### ![](/files/lzopMboA31bVq8UIcbT3) OnRightToLeftChanged(e)

Fires the [RightToLeftChanged](#righttoleftchanged) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebRender(config)

Renders the client component.

| Parameter  | Type                                                          | Description                   |
| ---------- | ------------------------------------------------------------- | ----------------------------- |
| **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. |

### ![](/files/hsR4ok3152WyAf8J2C1u) SetError(control, value)

Sets the error description string for the specified control.

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

**Throws:**

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

### ![](/files/hsR4ok3152WyAf8J2C1u) SetIconAlignment(control, value)

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

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

**Throws:**

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

### ![](/files/hsR4ok3152WyAf8J2C1u) SetIconPadding(control, value)

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

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

**Throws:**

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

### ![](/files/hsR4ok3152WyAf8J2C1u) UpdateBinding()

Updated the bindings.

## Events

### ![](/files/hsR4ok3152WyAf8J2C1u) ErrorChanged

[ErrorProviderErrorChangedHandler](/api/wisej.web/extenders/errorprovider/wisej.web.errorprovidererrorchangedhandler.md)

### ![](/files/hsR4ok3152WyAf8J2C1u) RightToLeftChanged

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

## Implements

| Name                                                                              | Description                                                                                                                           |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata.md)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface.                       |
| [IErrorProvider](/api/wisej.web/interfaces/wisej.web.ierrorprovider.md)           | Exposes a common api implemented by components that can collect errors in relation to a [Control](/api/wisej.web/general/control.md). |
| [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                                        |
| [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.                                                                                                 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/extenders/errorprovider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
