Hi,
I use the XamNumericInput control with following settings.
this.Mask = "nnnnnnnnnnnnn.nnnn";
this.PromptChar = new Char();
this.TrimFractionalZeros = true;
this.DisplayMode = InputMaskMode.Raw;
this.DataMode = InputMaskMode.Raw;
1. The property "SelectionStart" don`t show the correct cursor position.
2. When the cursor is at the end or begin of the text, I can`t move the cursor with the arrow keys.
3. Type "123.123" in the textbox. Select all characters with the mouse from right to left in the textbox and delete the selected text. Now the XamNumericInput control shows ".1".
I believe, the XamNumericInput control have problems when the prompt char is empty.
Regards
Marco
Hi Marco,
280872 said:3. Type "123.123" in the textbox. Select all characters with the mouse from right to left in the textbox and delete the selected text. Now the XamNumericInput control shows ".1".
I'm not seeing the same behavior you are for this. When I enter in the numbers 123.123 then select all characters with the mouse from right to left and press Delete, all the characters are deleted normally. Are there any other settings you have applied to the XamNumericInput, maybe in your XAML?
280872 said:2. When the cursor is at the end or begin of the text, I can`t move the cursor with the arrow keys.
I think what you're seeing is that the caret is still taking into account the empty spaces created by having an empty PromptChar so it looks like the cursor is stuck. I'm going to research this and see if theres a way you can restrict the caret position so that it does not travel past actual text.
280872 said:1. The property "SelectionStart" don`t show the correct cursor position.
How and where are you setting the SelectionStart property?
To 1. I have add a sample to show the problem with the SelectionStart property.
To 3. I can`t reproduce the delete problem. Forget it.
SelectionStart is technically showing the correct cursor position because it is still taking the PromptChar for each digit into consideration. Even though PromptChar is set to an empty string, the XamNumericInput still keeps track of them for each digit. In your sample, the mask is set to "nnnnnnnnnnnnn.nnnn" which is 18 digits. Because of this you'll notice that if you click into the control, SelectionStart will start at 0 and when you press the right arrow key, SelectionStart increments even though the cursor doesn't seem to move. It is technically 'moving' but since PromptChar="" the cursor doesn't visually change position. Now I've tested this same sample but with PromptChar=" " and I noticed that the behavior is now different. After typing '123', when I try to move the cursor towards the left, SelectionStart ends at 10 and won't continue further which seems to be the behavior you want.
As I believe this issue and issue #2 are related to each other, I've asked our engineering staff to examine this further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a development ID of 108867.
I have also created a private case for you to which this development issue is linked with. This way you will be automatically updated when development provides a fix or other resolution. The case number is CAS-88714-V4GHJ1. You can access your case through the 'My IG' tab under 'My Support Activity' on the Infragistics website.