Quantcast
Channel: wpftoolkit Wiki Rss Feed
Viewing all articles
Browse latest Browse all 892

Updated Wiki: DecimalUpDown

$
0
0

DecimalUpDown

The DecimalUpDown control provides a TextBox with button spinners that allow incrementing and decrementing Nullable<Decimal> values by using the spinner buttons, keyboard up/down arrows, or mouse wheel.

Usage

decimalupdown.jpg

When using the DecimalUpDown in data binding scenarios, bind your object's value to the Value property. You can specify how much to increment the value by setting the Increment property. You can control the minimum and maximum allowed values by setting the Minimum and the Maximum properties. Use IsReadOnly to determine whether the control is read only. If you would like to get the actual formatted string representation of the value, you can use the Text property.

Applying FormatStrings

Default:
decimalupdown_default.jpg
<xctk:DecimalUpDown Value="1564.6749586" />


Floating Point:
decimalupdown_float.jpg
<xctk:DecimalUpDown FormatString="F3" Value="1564.6749586" Increment=".001"  Maximum="200000.599" />


Currency:
decimalupdown_currency.jpg
<xctk:DecimalUpDown FormatString="C2" Value="1564.6749586" Increment=".5" Maximum="5000.50" Minimum="50.01" />


Supported Format Strings

Format Specifier Name
C Currency
F Fixed Point
G General
N Number
P Percent


Watermark

You can provide a Watermark to show text in place of a NULL Value.

decimalupdown_watermark.jpg
<xctk:DecimalUpDown Watermark="Enter Decimal" />


Properties / Events

Property Description
AllowSpin Gets or sets the ability to perform increment/decrement operations via the keyboard, button spinners, or mouse wheel.
CultureInfo Gets or sets the current CultureInfo.
DefaultValue Gets or sets the value to use when the Value is null and an increment/decrement operation is performed.
FormatString Gets or sets the dispaly format of the Value.
Increment Gets or sets the amount in which to increment the value.
IsReadOnly Gets or sets a value indicating whether the control is read only.
Maximum Gets or sets the maximum allowed value.
Mimum Gets or sets the minimum allowed value.
MouseWheelActiveOnFocus Gets or sets if the control must have focus in order for the mouse wheel to incement/decrement the value. By default, True.
SelectAllOnGotFocus Gets or sets if all text is selected when control gets focus.
ShowButtonSpinner Gets or sets if the button spinners are visible.
Text Gets or sets the formatted string representation of the value.
TextAlignment Gets or sets the alignment of the Text
Value Gets or sets the numeric value.
Watermark Gets or sets the object to use as a watermark if the Value is null.
WatermarkTemplate Gets or sets the DataTemplate to use for the Watermark.


Event Description
ValueChanged Raised when the Value changes.


Support this project, check out the Plus Edition.
---

Viewing all articles
Browse latest Browse all 892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>