Numeric TextBox Controls
Back
Peter's Data Entry Suite includes four textboxes that handle numeric data. Here
are the features of each numeric TextBox.
- IntegerTextBox - Allows only integers. Options include only allowing positive numbers
and showing the thousands separator.
- DecimalTextBox - Allows decimal values. Options include only allowing positive
numbers, showing the thousands separator, establishing a limit of decimal digits,
and adding trailing zeros.
- CurrencyTextBox - Allows currency values. Options include allowing the currency
symbol, allowing only positive numbers, allowing extra decimal digits, and showing
the thousands separator.
- PercentTextBox - Allows percentage values. Options include allowing the percentage
symbol and support for either integer or decimal formatting.
They all offer these features:
- Filter keystrokes and reformat as you exit the field.
- Use fuzzy logic to handle minor errors like extra decimal characters or back-to-back
thousands separators.
- Supports any culture by using the Culture of the page or one you assign.
- Offer spinner buttons to increment and decrement their values.
- Get and set the value of the textbox through a property reflecting the datatype
(integer or double) instead of using the Text property and converting it yourself.
- It inherits from the DES TextBox, gaining all of the javascript technologies from
its ancestor such as "value when blank", interactive hints, and autotabbing.
Demo 1 - IntegerTextBox
Positive and negative
Positive only
(allows
thousands separators; shows spinners)
ASP.NET Syntax for this demo
Positive and negative
<des:IntegerTextBox ID="IntegerTextBox1" runat="server" Width="100px" />
<br/>
Positive only
<des:IntegerTextBox ID="IntegerTextBox2" runat="server" Width="100px" ShowThousandsSeparator="True"
AllowNegatives="False" ShowSpinner="True" />
Demo 2 - DecimalTextBox
Positive and negative
Positive only
(allows thousands separators; shows spinners)
ASP.NET Syntax for this demo
Positive and negative
<des:DecimalTextBox ID="DecimalTextBox1" runat="server" Width="100px" />
<br/>
Positive only
<des:DecimalTextBox ID="DecimalTextBox2" runat="server" Width="100px" ShowThousandsSeparator="True"
AllowNegatives="False" ShowSpinner="True" />
Demo 3 - CurrencyTextBox
Without Currency Symbol
With Currency Symbol&anbsp;
(allows thousands separators; positive only; shows spinners)
ASP.NET Syntax for this demo
Without Currency Symbol
<des:CurrencyTextBox ID="CurrencyTextBox1" runat="server" Width="100px" />
<br/>
With Currency Symbol
<des:CurrencyTextBox ID="CurrencyTextBox2" runat="server" Width="100px" ShowThousandsSeparator="True"
AllowNegatives="False" UseCurrencySymbol="True" ShowSpinner="True" />
Demo 4 - PercentTextBox
Integer only
Decimal
(shows
spinners)
ASP.NET Syntax for this demo
Integer only
<des:PercentTextBox ID="PercentTextBox1" runat="server" Width="40px" />
<br/>
Decimal
<des:PercentTextBox ID="PercentTextBox2" runat="server" Width="40px" ShowSpinner="True"
WholeNumbersOnly="False" MaxDecimalPlaces="2" />
Back