
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"></des:IntegerTextBox>
<br>
Positive only
<des:IntegerTextBox id=IntegerTextBox2 runat="server" Width="100px"
ShowThousandsSeparator="True" AllowNegatives="False" ShowSpinner="True"></des:IntegerTextBox>
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"></des:DecimalTextBox>
<br>
Positive only
<des:DecimalTextBox id=DecimalTextBox2 runat="server" Width="100px"
ShowThousandsSeparator="True" AllowNegatives="False" ShowSpinner="True"></des:DecimalTextBox>
Demo 3 - CurrencyTextBox
Without Currency Symbol
With Currency Symbol
(allows thousands separators; positive only; shows spinners)
ASP.NET Syntax for this demo
Without Currency Symbol
<des:CurrencyTextBox id=CurrencyTextBox1 runat="server" Width="100px"></des:CurrencyTextBox>
<br>
With Currency Symbol
<des:CurrencyTextBox id=CurrencyTextBox2 runat="server" Width="100px"
ShowThousandsSeparator="True" AllowNegatives="False" UseCurrencySymbol="True"
ShowSpinner="True"></des:CurrencyTextBox>
Demo 4 - PercentTextBox
Integer only
Decimal
(shows
spinners)
ASP.NET Syntax for this demo
Integer only
<des:PercentTextBox id="PercentTextBox1" runat="server" Width="40px">
</des:PercentTextBox><br>
Decimal
<des:PercentTextBox id="PercentTextBox2" runat="server" Width="40px"
WholeNumbersOnly="False" MaxDecimalPlaces="2" ShowSpinner="True">
</des:PercentTextBox>
Back
|