DoubleUpDown

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

Usage

decimalupdown.jpg

When using the DoubleUpDown 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:DoubleUpDown Value="1564.6749586" />


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


Currency:
decimalupdown_currency.jpg
     <xctk:DoubleUpDown 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.

doubleupdown_watermark.jpg
     <xctk:DoubleUpDown Watermark="Enter Double" />


Properties / Events

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


Event Description
ValueChanged Occurs when the Value changes.

Last edited May 27, 2013 at 8:22 PM by DavidCPx, version 7

Comments

BoucherS Oct 3, 2013 at 12:47 PM 
Hi, when I delete the value in a doubleUpDown, it fires the "ValueChanged" event. Can you create a new discussion tab and post a sample please.
Thanks.

sriman_ch Oct 3, 2013 at 6:18 AM 
Hi,

When I am emptying the text in doubleupdown control, its not firing value changed event. How can I rectify this problem ?

Regards
Sriman

emartin Dec 10, 2012 at 3:54 PM 
tlaemmlein, This issue has been created to answer your need:
http://wpftoolkit.codeplex.com/workitem/19033

tlaemmlein Dec 9, 2012 at 2:27 PM 
Hi,
it is possible to clip the value to the min/max values? Example the Maximum is 150.75 and the user types 999. The result should be 150.75.
Regards,
Thomas