Hello,
I have a XamDataGrid with a numeric editable column. When entering edit mode, the grid automatically chooses the XamNumericEditor based on the column's type. I would like the editor to allow the user to type in multipliers, but otherwise act as XamNumericEditor.
e.g. User types "195k"; value becomes 195000. User types "3m"; value becomes 3000000
The XamNumericEditor does not seem to have this functionality, nor does it allow non-numeric characters to be entered.
Thank you.
Hello David,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I set the Field’s EditorType Property to be a XamTextEditor and handled its EditModeEnding event and in there I convert the Value if it contains ‘m’ or ‘k’. Please let me know if this helps you or you need further clarifications on this matter.
Looking forward for your reply.
Hi Stefan,
Thanks for your response. When I keep the column under its default settings, the column displays how I want it (number with commas between thousands, 2 numbers after decimal point). When I try your solution, this mask no longer gets applied. Is there any way to apply the default numeric mask after setting the EditorType to XamTextEditor.
Thanks
**EDIT**
Regarding formatting:
I mostly fixed my display issues by setting the EditorStyle... This properly sets the format to show commas while in display mode.
<Style x:Key="NotionalStyle" TargetType="{x:Type igEditors:XamTextEditor}" BasedOn="{StaticResource {x:Type igEditors:XamTextEditor}}" > <Setter Property="Format" Value="#,###.##"/> <Setter Property="ValueType" Value="{x:Type sys:Double}" /> </Style>
My one remaining issue is when in edit mode, any number >10m shows up as floating point notation. Is there a way to not allow that to happen?
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.