$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
How to Build NumericTextBox Input Using C#
Home > How to > Input NumericTextBox

NumericTextBox Input Overview for ASP.NET AJAX

If users choose NumericTextBox Input mode of KT.UI for ASP.NET SDK, then you can just input numeric values, including number, currency and percent.
In this page, users can get the composite guides on following topics:
  • How to use C# codes to set specific type by using NumericTextBox Input control within C# ASP.NET programming project
  • How to use C# codes to adjust the increment and decrement of input values in NumericTextBox through keyboard and mouse wheel
  • How to adjust the data range in NumericTextBox by using demo C# codes

C# Codes for Setting Type of NumericTextBox Input

ASP.NET AJAX PerInput NumericTextBox library of KT.UI supports three seperate numeric types - number, currency and percent, which can be selected and adjusted by invoking and applying Type property. The input number type you choose will decide the format of value in the text box when it does not have focus.
When users set the Type property as "Number", the input value is displayed and formatted as simple number, when users change the Type property as "currency", the input value will be formatted as currency and when users need to display the input value in percent format, you can set the Type property as "Percent".
Please directly use following C# codes to specify any NumericTextBox Input type.
PerNumericTextBox1.Type = NumericType.Number;

C# Demo Codes for Increment Setting

By using KT.UI NumericTextBox Input control, users are able to set ShowSpinButtons property as true within SpinButtons control to adjust the data value of NumericTextBox via the up and down arrows. Users can adjust the numeric values by using keyboard and mouse wheel.
Through keyboard: when set the InterceptArrowKeys property as “true” in IncrementSettings, users can specify the data value in NumericTextBox through up and down keys in keyboard.
Through mouse wheel: when set the InterceptMouseWheel property as “true” in IncrementSettings pane, users can change the data value in NumericTextBox by scrolling the mouse wheel.
            PerNumericTextBox1.ShowSpinButtons = true;
PerNumericTextBox1.IncrementSettings.InterceptArrowKeys = true;
PerNumericTextBox1.IncrementSettings.InterceptMouseWheel = true;
PerNumericTextBox1.IncrementSettings.Step = 1.0;

C# Sample Codes for Setting Data Range

Users can use following demo C# ASP.NET codes to set and define the data range in the numeric text box by using MaxValue and MinValue attributes.
            PerNumericTextBox1.MinValue = 0;
PerNumericTextBox1.MaxValue = 150;
ASP.NET AJAX UI Controls