Hello
I am using the ComboBoxField-Type in the XamDataGrid (2014.2) for a Combobox-column.Now I would like to have an individual listing in the Combobox per row (record).This will be independent from other values in the row.Example:Row 1 has a Combobox with entries A, B, CRow 2 has a Combobox with entries B, C, DRow 3 has a Combobox with entries X, Y, ZHow is it possible to achieve this?Alternatively it would be enough if each row has the same listing as the data source, yet per row the non-essential entries will be filtered / not displayed. In this case the desired entries are dependent on other values in the row and will govern which values can be selected in the Combobox.
Sincerely,
A. Kasar
Correction:
[...] This will be dependent from other values in the row. [...]
Hello Kasar,
Thank you for your post. I have been looking into the requirements that you are having and I can suggest using a EditorStyle for the ComboBoxField and add a Setter for the ItemsSource. The DataContext of the XamComboEditor in the Cell is the DataRecord and you can bind to its DataItem for example and there. You can add a collection property in your ViewModel for the rows and through the DataItem to bind each individual record. I have created a sample application for you that shows how you can implement this approach.
Please let me know if I can assist you with anything else.
Krasimir, MCPD
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
I found a different problem with that approach:
After applying an editor style, the combo box is no longer rendered in the applications theme (RoyalDark in my case).
Before:
After:
Hello Wolfgang,
I am assuming that by the editor style you are applying, you are referring to the "EditorStyle" property of the Field or FieldSettings of a particular Field. If this is incorrect, please let me know.
Assuming my above assumption is correct, it appears that the XamComboEditor is falling back on its default styling. Since WPF elements only keep a single local style, I imagine your EditorStyle likely does not base off of the RoyalDark version of your XamComboEditor style, causing this behavior. You can prevent this by using the following "BasedOn" statement in your EditorStyle, where "igThemes" points at xmlns:igThemes="http://infragistics.com/Themes":
<Style TargetType="{x:Type igEdit:XamComboEditor}" BasedOn="{x:Static igThemes:EditorsRoyalDark.XamComboEditor}"/>
I hope this helps. Please let me know if you have any other questions or concerns on this matter.
Yes, that did it. Thanks!