Hi there,
we have the need to let the user edit a numeric value OR select a numeric value from a list.
To solve this I'd like to use an editable combobox where I can set the decimal and thousands separators using an input mask.
Is this possible in any way?
Best regards!
Hello,
In order to set mask for the items in the XamComboEditor you may define an ItemTemplate for the control and put a control that expose masks e.g. XamNumericEditor. Then you can set the mask to one of the supported types which are described here: https://ko.infragistics.com/help/wpf/xameditors-masks
Please let me know if you have any questions.
Hello Nick,
thank you for the answer. Do you have a sample on how to do something like that?
Hello,If you want to apply mask to XamComboEditor, while it is in edit mode you have to change the EditTemplate. You can find it on your machine in DefaultStyles folder:
C:\Program Files (x86)\Infragistics\2016.2\WPF\DefaultStyles\Editors\EditorsGeneric.xaml
In ComboEditor_TextBoxStyle there is a ScrollViewer which you can replace with XamNumericEditor and you have to bind it to the TemplatedParent.
Following this approach I have created sample project.
If you want to apply mask only to the items in the XamComboEditor's dropdown list, you can remove the code in XamComboEditor.EditTemplate and apply the following code:
<igEditors:XamComboEditor.ComboBoxStyle> <Style TargetType="ComboBox"> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> <igEditors:XamNumericEditor Mask="{}{currency:-4.3}" Value="{Binding Item}"/> </DataTemplate> </Setter.Value> </Setter> </Style> </igEditors:XamComboEditor.ComboBoxStyle>
thank you, I'll have a look at it!