# NumericEdit

## Content



The NumericEdit control is a control derived from the TextBox control which accepts numeric type values only. It comes with spin up and spin down buttons to increment or decrement the numeric values. The control supports various numeric formats including Currency, DateTime, Scientific etc. using the [FormatType](/componentone/docs/win/online-input-net/) property. You can set the [Increment](/componentone/docs/win/online-input-net/) property to specify the interval by which spin buttons should increment or decrement the value. Moreover, NumericEdit lets you increase or decrease the values programmatically using [SpinUp](/componentone/docs/win/online-input-net/)() or [SpinDown](/componentone/docs/win/online-input-net/)() methods provided by the class.

```ADD
numEdit = new C1NumericEdit();
Controls.Add(numEdit);
numEdit.Location = new Point(10, 170);
numEdit.Size = new Size(100, 30);
numEdit.Text = "12";
numEdit.NumericInputKeys = NumericInputKeys.All;
numEdit.Increment = "3";
```

### Elements

The NumericEdit control consists of two parts: textbox and spin buttons.

![NumericEdit elements](https://cdn.mescius.io/document-site-files/images/287a0e06-68cb-453e-816c-125f892133e7/images/numeric-edit.png)

**TextBox**: This is the are which displays the value. In NumericEdit control, the textbox can accept only numeric type values.

**Spin Up/Down Buttons**: These are the buttons provided to change the value of the control just by clicking. [UpDownButtonClick](/componentone/docs/win/online-input-net/#UPDOWNBUTTONCLICK) event is fired each time these buttons are clicked.

### Data Binding

Binding a control with a data source gives you ability to communicate and even update the underlying data through the control. The NumericEdit control can be bound to numeric type fields like Integer, DateTime etc. of a data source using [DataSource](/componentone/docs/win/online-input-net/) property of the C1NumericEdit class. You can specify the field to be bound to control using the [DataMember](/componentone/docs/win/online-input-net/) property.

```DATA
c1NumericEdit1.DataSource = bSource;
c1NumericEdit1.DataMember = "ProductID";
c1NumericEdit1.DataType = typeof(int);
```