Hello,
I need to show in a comboboxcolumn two properties of a complex object.
To achieve that I used the ValueConverter but it doesn't show me anything.
I attached a sample to show you how I do it.
Regards.
Hello Coso,
In the ComboBoxColumn set the SelectedValuePath and DisplayMemberPath properties.
Let me know if I can provide any further assistance.
Hello Duane,
I set the displamemberpath and selectedValuePath to property "Rue" but it doesn't work either.
Yes this method will only work if the column is bound to a complex object which contains all the fields. In your case of only having the first value, your best option may be to rearrange your data so that the values you want to combine are encapsulated into another object and this object is bound to your grid. By the changing data representation in your view model you can easily use the functionality as is in the grid without having to deal with changing styles.
I would recommend creating two complex objects for the columns (implementing IComparable and overriding ToString) and then including object in the items in the list bound to the grid.
Please see modified sample.
Let me know if you have any questions.
Sincerely,
Valerie
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hello Valerie,
Thanks for your response. But I can't change my data representation, so I tried a last solution by taking one of yours (http://ko.infragistics.com/community/forums/p/59382/301863.aspx#301863). It could be a solution for me but I have some troubles with it :
- The filters are not applied correctly,
- The ClearFilters button doesn't works,
- The empty data text appears some times,
- The select all checkbox behavior doesn't works.
What am I doing wrong ?
The issue is that the underlying value of the cell does not contain the full text that is populated during the display using the converter. Therefore when filtering, the filter is taking the value displayed in the listbox (ex Nom + Prenom) and trying to compare this to the partial value in the cell (ex Nom). Using MVVM the idea would be that your data is represented as it is maintain in your model and then the classes can be refactored in your ViewModel to support binding to the view. This would be your best and simplest approach to resolving this issue.
Please let me know if you have any questions.
Do you have any other questions on this matter?
Sorry for the late answer, I found a solution by adding a partial class with my data where I put a property that represent what I need.
With this I can use a TextColumn and filter it.
Thanks for your help.
Thank you for sharing your solution.
Sincerely,ValerieDeveloper Support Engineer Infragisticswww.infragistics.com/support