Extended WPF Toolkit™ Community Edition DecimalUpDown

decimalUpDown.jpg

The free Community Edition of the Exceed DecimalUpDown provides a textbox with up and down arrows to allow incrementing numeric values up or down by a value of 1.

WPF Composites also provides two additional methods to make working with the DecimalUpDown control easier.

The first is a method called AddNumericTextBox that you may call within BeginComposite . . . EndComposite. It lets you define decimal values including: min value, max value, starting value, and increment value. You may also choose whether to select all text when focus is set on the control. Lastly, you may enter a format string as follows:
C-Currency
F-Fixed Point
G-General
N-Number
P-Percent

Examples:
//Currency with 2 decimal places
.AddNumericTextBox<Grid>(9, 3, 139D, 23D, 299.99M, 999.99M, 0.00M, 1.00M, "C2", true)
//Percent with 2 decimal places
.AddNumericTextBox<ContentControl3D>(7, 1, 139D, 23D, .99M, 1.00M, 0.00M, .010M, "P2", true)

The second is a method called GetValueFromNumericTextBox which lets you retrieve the current value from the DecimalUpDown control as a Nullable decimal.

Example:
//get nullable decimal value from DecimalUpDown control at row-column 9-3 in Composite (Border)
decimal? myDecimal = thisComposite.GetValueFromNumericTextBox<Grid>(9, 3);

Last edited May 26, 2014 at 3:38 AM by stagathome0069, version 8

Comments

No comments yet.