Hello,
I'm trying to add a XamComboEditor into my XamDataGrid and I'm facing 2 issues:
1- When I populate my XamComboEditor, it displays everything as expected, but when I click on any of the values the box closes and doesn't update the value in the grid. Below is the code that I'm using:
<igDP:Field Name="Property" Label="text"> <igDP:Field.Settings> <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="ItemsSource" Value="{Binding DataItem.ObservableCollection}" /> <Setter Property="IsEditable" Value="True" /> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
2- I need to filter the values when typing in the box, e.g. Items = one,two,three, if I type "t" two,three should only show as options.
Hello Carlos,
Thank you for your post. I have been investigating the behavior you are looking to achieve, and I have a couple of recommendations. I will answer your inquiries in the order they were asked.
1. This sounds like there is a difference between the type of your “Property” that your Field is bound to and the items in the DataItem.ObservableCollection. Would it be possible for you to please provide the property definitions of these two properties on your data item in this case?
2. The Infragistics.Windows.Editors.XamComboEditor is a wrapper for the WPF built-in ComboBox for use in the XamDataGrid. Filtering is not currently implemented on this element, but there is an auto-complete functionality implemented by default if IsEditable is true, which in this case, it is.
If you would like to implement filtering, you may be able to do so by using an EventSetter in your EditorStyle for the TextChanged event. In there, you can catch as the user changes the text and query the collection bound to the ItemsSource of your XamComboEditor so that only a subset is shown based on the text.
If you would like to see filtering implemented by the XamComboEditor by default, I would recommend suggesting a new product idea for this at our WPF Ideas Site. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.
Please let me know if you have any other questions or concerns on this matter.
Thank you Andrew,
These are the properties that I have defined in my model:
public ObservableCollection<String> ObservableCollection { get { //returns a list of choices return choices; } } public string property { get { return mModel.property; } set { mModel.property = value; } }
In regards of the filtering, would you be able to provide me with a small example ?
I have created a sample project to demonstrate the behaviors I had recommended above. It is attached.
Using this sample project, I cannot currently reproduce the behavior you are seeing that the XamComboEditor blanks out when selecting a new value, though. It may be helpful if you can modify the sample project such that it reproduces this behavior. My tests were made against version 18.1.20181.255 of Infragistics for WPF 2018.1.
XDGComboFilteringDemo.zip
Hi again Andrew, I solved most of the issues. Thank you ! The list still closes for no reason. I found that when right clicking the list I can select an item, it is like the list is not focused or some other element is causing this behavior.