Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
875
Possible Bug in XamCurrencyEditor
posted

We’re having a problem with XamCurrencyEditor when its properties are set a specific way.

Here's the problem: If you want to enter only a cents value into the editor (say $0.25), you have to either (a) press decimal point twice or (b) enter a leading zero first. If you press decimal point once, any digits entered are taken as the dollar value.

For example, if I want to enter 25 cents and press decimal point, then 2, then 5, it ignores the decimal point and displays a value of $25.00.

Here's the specific set of property settings that lead to this situation:

  1. We set PromptChar to the null character (‘\0’) since that hides the prompt character.
  2. We are using this editor outside of the grid control (as a stand-alone editor), so we set IsAlwaysInEditMode to true.
  3. We call SelectAll() to initially select the value (so the user can quickly overtype the value).

This does not happen when PromptChar is something other than null (like the default underscore value) or when SelectAll() isn't called.

Here's some sample XAML/C# to illustrate the scenario:

 

 

 

 

 

 

<igEditors:XamCurrencyEditor x:Name="zzz" Width="150"
 
IsAlwaysInEditMode="True" Value="123.45" />

InitializeComponent();

 

this.zzz.PromptChar = '\0';
this.zzz.SelectAll();

Parents Reply Children