Hi,
I have a strange issue where in XamNumericEditor is being used inside XamDataGrid as Field Editor Style. When the cell is in edit mode there is a "." dot present there. I am aware that its because of the mask. However, I would like to get rid of the dot as its causing confusion to users.
<igEditors:XamNumericEditor x:Name="testEditor" VerticalAlignment="Top"
Width="100" PromptChar="" Mask="nnnnnnnnnnnnn.nnnnnnnnnn" Format="#,0.##########" TrimFractionalZeros="True">
</igEditors:XamNumericEditor>
This field accepts both integers and decimals for values. The ask is that unless the "dot" is typed explicitly from the keyboard it should not be present.
Another issue is that when the cell is clicked in the right-most corner to kick off the editing - the cursor is focused on the right of the decimal point, because of which the user inadvertently captures a fractional value when he meant it to be a whole number.
I have looked in to XamMaskedEditor with RegEx - but IMHO that's ugly hack and I lose other goodness of Numeric Editor.
<igEditors:XamMaskedEditor Width="200"
PromptChar=""
ValueType="system:Decimal"
Mask="{}{char:24:.0-9}"
HorizontalContentAlignment="Right"
VerticalAlignment="Center" EditModeValidationError="ValueEditor_OnEditModeValidationError" >
<igEditors:XamMaskedEditor.ValueConstraint>
<igEditors:ValueConstraint ValidateAsType="Decimal"
RegexPattern="\d{1,13}(\.\d{1,10})?" />
</igEditors:XamMaskedEditor.ValueConstraint>
</igEditors:XamMaskedEditor>
Is there any way this can be solved in XamNumericEditor?
PS: I am using version 14.1.2108
Any comments?
Can someone advise here please?
Hello Tushar,
Thank you for posting!
The .(Dot) is displayed as a decimal separator for the editor. When it is set within the mask, it could not be hidden when in edit mode. You may have a look at the alternative approach Stefan has shared at http://www.infragistics.com/community/forums/t/79867.aspx. May be using the XamTextEditor where the .(dot) is not displayed in edit mode could be an option for your scenario.