Skip to main content

ejNumericTextbox

Namespace: Wisej.Web.Ext.Syncfusion

Assembly: Wisej.Web.Ext.Syncfusion (4.1.0.0)

NumericTextBox is used to display only numeric values. It has Spin buttons to increase or decrease the values in the Text Box.

public class ejNumericTextbox : ejBase

Constructors​

Instance member ejNumericTextbox()​

Constructs a new instance of the ejNumericTextbox class.

Example:

The following example creates the numeric text box and sets the value and the range through the options.

var numeric = new ejNumericTextbox();
numeric.Options.value = 10;
numeric.Options.minValue = 0;
numeric.Options.maxValue = 100;
numeric.Location = new Point(20, 20);
this.Controls.Add(numeric);

Instance member ejNumericTextbox(options)​

Constructs a new instance of the ejNumericTextbox class.

NameTypeDescription
optionsObjectInitial set of options.

Example:

The following example creates a numeric text box with two decimal places that changes by 0.5 at each step.

var numeric = new ejNumericTextbox(new
{
value = 2.5,
decimalPlaces = 2,
incrementStep = 0.5,
minValue = 0,
maxValue = 10
});
this.Controls.Add(numeric);

Properties​

Instance member Text​

String: Gets or sets the text for the ejNumericTextbox. (Default: "")

The property reads and writes the value option of the widget and raises the TextChanged event every time it is assigned. The getter returns null when the option is not set. The setter compares the new text with the current value option: set the option, either in the constructor or through Options, before assigning this property, and do not assign null.

The property is not updated when the user changes the number in the browser: handle the change event of the widget to receive the value entered by the user.

Example:

// the value option must be set before using the Text property.
var numeric = new ejNumericTextbox(new { value = 10 });
numeric.Text = "25";

// receive the value entered by the user.
numeric.Instance.onChange += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"Value: {e.Data.value}");
});

Implements​