Hi there
I have data items with the following structure
I add the collection of the items to a XamDataGrid. It displays the columns as I like (IdRelated-Text1, IdRelated-Text2 and other properties). I disabled the auto generation of the columns. Now I like to add a MultiColumnComboBox to the cells of the two IdRelated-Text columns. The multi column combobox should display the two IdRelated-Text as columns in the drop down list of the combobox. When I select an item, it should change the value of the Id column (which is hidden) and not the IdRelated-Text columns directly.
What is the best practice to do that?
ThanksRoman
Hi Roman,
You can add a XamMultiColumnComboEditor to the cells of the grid by creating a new style targeting a CellValuePresenter and adding the combo editor to its template. You can then hook up the SelectedItem to the Id property and use a converter to set the Id to the proper value based on what item was selected.
As for populating the combo editor I wasn't sure how you planned on doing it from your description so I just gave it some random data. I've attached the sample.
Let me know if you have any questions on this.
Hi,
I know this post is pretty old, but at this time, with the last version of Infragistics XamDataGrid it is not, nativelly, possible to user a multicolumncombobox as a field.
This is why I use your trick (now with introducing the combobox in the TemplateField.EditTemplate section) ; it works perfecty to display and edit data, but not to sort or filter data.
Sorting and filtering data are based on valueMember not displayMember.
Have you another trick to make it work ?
Any answer, I still have the same issue, not able to filter with displaymember ????
Hi Stephane,
You could try using the ValueToTextConverter on TemplateField. If that doesn't help I recommend opening a new thread so we can better help you rather than reviving an existing thread. You can link to this thread to give our support team some more context.