Hello,
is it possible to specifiy a display format for numeric values? I want to show a numeric value with it's UOM in the propertygrid row.
E.g. Height | 10 mm
When the value is editing, the UOM shouldn't be displayed. The UOM and the value itself are 2 properties.
Hello Markus,
You can use the XamPropertyGrid's EditorDefinitions to target a numeric type e.g.:<ig:PropertyGridEditorDefinition TargetType="{x:Type sys:Int32}">
You can then add in the PropertyGridEditorDefinition.EditTemplate a DataTemplate in which you can add several elements - TextBlock, TexBox, which will be bound to the different properties. You can check if the TextBox IsFocused and hide the TextBlock through a converter.
You can take a look at the attached sample for an example of this functionality.
Thanks, that is working but then I need for every property a second one.
Is is possible to write an Attribute, where I can set the displayformat as an property attribute like DisplayName?
e.g.
[DisplayFormat("0.## kg"]
Thank you for the feedback.
I will suggest to take a look at the List of Supported Attributes (xamPropertyGrid).
Additionally you can take a look at this forum post:
https://es.infragistics.com/community/forums/t/104668.aspx
Where Andrew has explained how to set Mask/Format in XamProperyGrid through style.