# NumericUpDown

URL: https://docs.wisej.com/api/wisej.web/editors/wisej.web.numericupdown

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

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

- Control
- [UpDownBase](/api/wisej.web/editors/wisej.web.updownbase)
- [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown)
Represents a spinner control that displays numeric values.

- C# - VB.NET

```csharp
public class NumericUpDown : UpDownBase, ISupportInitialize, INotifyPropertyChanged
```

```visual
Public Class NumericUpDown
    Inherits UpDownBase
    Implements ISupportInitialize, INotifyPropertyChanged
```

## Constructors

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

Initializes a new instance of the [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) class.

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

Initializes a new instance of the [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) class with specific initial settings.

| Name | Type | Description | **onValueChanged** | [Action<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | The delegate to invoke when the [ValueChanged](/api/wisej.web/editors/wisej.web.numericupdown#valuechanged) event is raised. 

### ![Instance member](/img/api/instance.png) NumericUpDown(label, onValueChanged)

Initializes a new instance of the [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) class with specific initial settings.

| Name | Type | Description | **label** | [String](https://docs.microsoft.com/dotnet/api/system.string) | Initial [LabelText](/api/wisej.web/editors/wisej.web.updownbase#labeltext) value. | **onValueChanged** | [Action<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | The delegate to invoke when the [ValueChanged](/api/wisej.web/editors/wisej.web.numericupdown#valuechanged) event is raised. 

### ![Instance member](/img/api/instance.png) NumericUpDown(location, size, onValueChanged)

Initializes a new instance of the [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) class with specific initial settings.

| Name | Type | Description | **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | The Point specifying the upper-left corner of the NumericUpDown control relative to the upper-left corner of its container. | **size** | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) | The Size of the NumericUpDown control. | **onValueChanged** | [Action<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | The delegate to invoke when the [ValueChanged](/api/wisej.web/editors/wisej.web.numericupdown#valuechanged) event is raised. 

### ![Instance member](/img/api/instance.png) NumericUpDown(label, location, size, onValueChanged)

Initializes a new instance of the [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) class with specific initial settings.

| Name | Type | Description | **label** | [String](https://docs.microsoft.com/dotnet/api/system.string) | Initial [LabelText](/api/wisej.web/editors/wisej.web.updownbase#labeltext) value. | **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | The Point specifying the upper-left corner of the NumericUpDown control relative to the upper-left corner of its container. | **size** | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) | The Size of the NumericUpDown control. | **onValueChanged** | [Action<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | The delegate to invoke when the [ValueChanged](/api/wisej.web/editors/wisej.web.numericupdown#valuechanged) event is raised. 

## Properties

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Gets or sets whether the control allows empty text. (Default: `False` )

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns or sets the number of decimal places to display in the spin box (also known as an up-down control). (Default: `0` )

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The value assigned is less than 0; or the value assigned is greater than 99.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether the spin box (also known as an up-down control) should display the value it contains in hexadecimal format. (Default: `False` )

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

[Decimal](https://docs.microsoft.com/dotnet/api/system.decimal) : Returns or sets the value to increment or decrement the spin box (also known as an up-down control) when the up or down buttons are clicked. (Default: `1` )

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The assigned value is not greater than or equal to zero.

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

[Decimal](https://docs.microsoft.com/dotnet/api/system.decimal) : Returns or sets the maximum value for the spin box (also known as an up-down control). (Default: `100` )

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

[Decimal](https://docs.microsoft.com/dotnet/api/system.decimal) : Returns or sets the minimum allowed value for the spin box (also known as an up-down control). (Default: `0` )

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

[Nullable<Decimal>](https://docs.microsoft.com/dotnet/api/system.nullable-1) : Returns or sets the [Value](/api/wisej.web/editors/wisej.web.numericupdown#value) assigned to the spin box (also known as an up-down control) with the difference that when the text is empty it returns null. (Default: `0` )

This property should be used when the [NumericUpDown](/api/wisej.web/editors/wisej.web.numericupdown) may hold a null value and it's bound to a database nullable column. **Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The assigned value is less than the [Minimum](/api/wisej.web/editors/wisej.web.numericupdown#minimum) property value; or the assigned value is greater than the [Maximum](/api/wisej.web/editors/wisej.web.numericupdown#maximum) property value.

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

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets a string to display after the value. (Default: `""` )

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

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets a string to display before the value. (Default: `""` )

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether a thousands separator is displayed in the spin box (also known as an up-down control) when appropriate. (Default: `False` )

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

[Decimal](https://docs.microsoft.com/dotnet/api/system.decimal) : Returns or sets the value assigned to the spin box (also known as an up-down control). (Default: `0` )

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The assigned value is less than the [Minimum](/api/wisej.web/editors/wisej.web.numericupdown#minimum) property value; or the assigned value is greater than the [Maximum](/api/wisej.web/editors/wisej.web.numericupdown#maximum) property value.

## Methods

### ![Protected member](/img/api/protected.png) OnLeave(e)

Fires the [Leave](/api/wisej.web/general/control/#leave) event.

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

### ![Protected member](/img/api/protected.png) OnValidating(e)

Fires the [Validating](/api/wisej.web/general/control/#validating) event.

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

### ![Protected member](/img/api/protected.png) OnValueChanged(e)

Fires the [ValueChanged](/api/wisej.web/editors/wisej.web.numericupdown#valuechanged) 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. 

### ![Protected member](/img/api/protected.png) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type | Description | **e** | WisejEventArgs | Event arguments. 

### ![Protected member](/img/api/protected.png) OnWebRender(config)

Renders the client component.

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

### ![Protected member](/img/api/protected.png) OnWebUpdate(state)

Updates the client component using the state information.

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

### ![Protected member](/img/api/protected.png) UpdateEditText()

Displays the current value of the spin box (also known as an up-down control) in the appropriate format.

### ![Protected member](/img/api/protected.png) ValidateEditText()

Validates and updates the text displayed in the spin box (also known as an up-down control).

**Returns:**[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) . True if the text represents a valid value.

## Events

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

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the [Value](/api/wisej.web/editors/wisej.web.numericupdown#value) property has been changed in some way.

## Inherited By

| Name | Description | [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) . 

## Implements

| Name | Description | [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata) | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. | [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface. | [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget) | Controls that support drag & drop operations implement this interface. | [ILabel](/api/wisej.web/interfaces/wisej.web.ilabel) | Provides access to the [LabelWrapper](/api/wisej.web/editors/wisej.web.labelwrapper) associated with the controls that implement this interface. | [IReadOnly](/api/wisej.web/interfaces/wisej.web.ireadonly) | Provides access to the [ReadOnly](/api/wisej.web/interfaces/wisej.web.ireadonly#readonly) property for coontrols that support the read-only mode. | [IValidation](/api/wisej.web/interfaces/wisej.web.ivalidation) | Provides access to the validation events and properties property for controls that support validation. | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | All wisej components implement this interface. | [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol) | All wisej controls derived from theControl class must implement this interface. | [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.
