Hi,
I have a simple XamNumericEditor:
<igEditors:XamNumericEditor x:Name="RequestNumberEditor" Mask="9999999" HorizontalContentAlignment="Right" EditModeStarted="RequestNumberEditor_EditModeStarted" Text="{Binding Path=RequestNumber, Mode=TwoWay}" />
This works fine if I enter a value, say 112. However, if I remove the value (e.g. select all and then del or backspace), the value "112" is still kept in the Text and Value properties of the control, even though a blank value is shown on screen (interestingly, when looking at this using Snoop, the value is still displayed on screen...) If I delete the digits one by one, then the last digit deleted (e.g. "1") is kept in the Text/Value properties.
The actual type of "RequestNumber" is Nullable(Of Integer), so I would expect the control to be able to handle a null value here. Note all the EditModeStarted handler does is this: CType(sender, ISupportsSelectableText).SelectAll() to that the value is selected when the user clicks on the control.
I must be missing something obvious here...
Thanks,Michel
Thanks - what you suggested resolved all my problems. I've just started using the editors, after a year of pretty much sticking to the dock manager and datagrid. I wasn't clear on Text vs. Value, and just from the masks description in the documentation, I doubt I'd have thought of using "n" instead of "9". This also took care of another annoyance: Before, the cursor was placed in the middle of the editor, while now it's on the right, which is more "natural".
Thanks!Michel
A couple of questions/observations. The "9" mask character is just a digit placeholder that would mean that your end user could enter 9 9 9 which isn't a valid integer. I'm guessing that is not what you want so you probably want to use the "n" character (e.g. "nnnnnnn"). There is a list and description of the mask characters here in the help.
I see that you're binding to the Text property which means that the wpf binding has to convert/parse the text (which could be formatted if you set things like the format property). It would probably be better to bind to the Value property and set the ValueType to Int32.
I tried to reproduce the issue you're describing but couldn't so you might want to try getting the latest hotfixx and see if you still have the same issue. If you do, please post a sample here and we can look into it further.