xmlns:ig="http://schemas.infragistics.com/xaml"
We recommend that you use the xamCurrencyEditor control instead of the xamCurrencyInput control. The xamCurrencyInput is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamCurrencyInput during this time. For help or questions on migrating your codebase to the xamCurrencyEditor, please contact support.
This topic demonstrates how to add a xamCurrencyInput™ control to your application and use some of its more notable properties.
You need to first read the following topics:
The table below lists some of the configurable behaviors of the xamCurrencyInput control.
Add the Infragistics namespace.
Add required references
In order to add a xamCurrencyInput control to your application you must add the following assemblies to your project:
InfragisticsWPF.Controls.Editors.XamMaskedInput.dll
InfragisticsWPF.dll
Add the Infragistics namespace
In XAML:
xmlns:ig="http://schemas.infragistics.com/xaml"
In Visual Basic:
Imports Infragistics.Controls.Editors
In C#:
using Infragistics.Controls.Editors;
Add a xamCurrencyInput control.
In XAML:
<ig:XamCurrencyInput/>
In Visual Basic:
Dim input As XamCurrencyInput = New XamCurrencyInput()
In C#:
XamCurrencyInput currencyInput = new XamCurrencyInput();
The table below maps the desired configurations to property settings. The properties are directly accessed from the xamCurrencyInput control.
Set a Mask.
The most important part of setting up an input control is configuring the Mask property. Set a mask that suits your needs by:
In XAML:
<ig:XamCurrencyInput Mask="[Your Mask]" />
In Visual Basic:
currencyInput.Mask = "[Your Mask]"
In C#:
currencyInput.Mask = "[Your Mask]";
For more information on how to create a mask, please refer to the Masks.
Display error message when invalid value is entered.
There are several options for how the xamCurrencyInput control behaves when invalid value is entered by the user. If you set the InvalidValueBehavior property to DisplayErrorMessage, when the user enters an invalid value and tries to leave the control, an error message containing details on the error is displayed.
Let the user copy only the actual value to the clipboard.
By setting the ClipMode property to Raw, when the user copies the input’s contents to the clipboard, no prompt characters and mask literals are copied, only the actual number that the control contains.
Display a specific string when the value is null.
When no value is entered in the control or when it is bound to a null value, you can set a string that is displayed. You can do this by setting the NullText property to the desired string. In this way you can guide the user on what to enter or to explicitly indicate that no value has been entered.
Display different prompt character than underscore.
The default prompt character used in the xamCurrencyInput is underscore, but you can change this behavior by setting the PromptChar property to the desired character.
Display buttons for incrementing/decrementing the value.
If you want to display buttons for incrementing or decrementing the value of the xamCurrencyInput control you need to set the SpinButtonDisplayMode to Always, Focused, or MouseOver.
Change the increment value.
If you don’t specify the SpinIncrement property the default increment/decrement value used when the SpinButtons are clicked will be 1. However you may want it to be something else and you can do this by setting the desired value as the SpinIncrement.
Set the input to delete fractional zeros that are in the end of the value.
If you don’t want zeros in the end of the fractional part of the xamCurrencyInput’s value to be displayed you can set the TrimFractionalZeros property to True.
Enable/disable undo/redo operations.
By default, the xamInputs support undo/redo operations triggered by CTRL+Z and CTRL + Y keys combinations. If you want to disable this functionality, you can set the IsUndoEnabled property to False.
The images below demonstrate a xamCurrencyInput control in edit and display mode as a result of the following settings:
For detailed information about these properties, refer to their listing in the property reference section:
Following are some other topics you may find useful.