I'm looking for a way to customize a ComboEditorTool, such that the selected item would appear normally in the combo box but the drop down items would include a short description of the item. Attached is a picture of what I think it would look like.
In some ways it is closer to a gallery tool, and I am open to suggestions if it can be done with another control.
Hello Walter,
The above can be achieved using the ComboEditorTool in the XamRibbon. To do this, I would recommend writing a ComboBoxStyle for your ComboEditorTool, and setting it to a Style that targets ComboBox. You might already be doing this, and targeting the ItemTemplate property of the underlying ComboBox, but this will have the template show up in the actual combo-box, rather than just in the drop-down.
Instead of setting the ItemTemplate, I would recommend setting the ItemContainerStyle property of the ComboBox's style. This will accept a Style targeting the ComboBoxItem type. In this Style for ComboBoxItem, I would recommend setting the ContentTemplate property, as this will allow you to show a separate template in the drop-down to the one that is displayed in the ComboEditorTool.
I have attached a sample project to demonstrate the above. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Thanks for the quick reply!
This works quite well until I change the theme of the ribbon in the code you sent to Office2013 (which my application is using). Then it doesn't work.
When you use one of the themes for the XamRibbon in this case, I have found that the ItemTemplate needs to be used. In other words, you will need to set the ComboBoxStyle on your ComboEditorTool, and then set the ItemTemplate essentially to the DataTemplate that was being used for the ContentTemplate in the ItemContainerStyle from before. With the XamRibbon's themes, the ItemTemplate content should not show up in the text area of the combo tool after an item has been selected.
There appears to currently be an issue with the Office2013 theme, though, in that the ComboBoxItem style that we lay out currently sets the "Height" property instead of the "MinHeight" property to 22 pixels. This only appears to be an issue with the Office2013 theme, at the moment. To work around this issue for the time being, I would recommend including the theme files for the XamRibbon related to the Office2013 theme, and merge them instead of setting the Theme property of the XamRibbon. These files commonly exist at the following directory:
C:\Program Files (x86)\Infragistics\<your version here>\WPF\DefaultStyles\Ribbon
This will allow you to modify the ComboBoxItem style in the RibbonOffice2013.xaml file, while still merging the Office2013 theme with your XamRibbon. I have attached a sample project to demonstrate the above.
This is unexpected behavior, and I have logged an internal development issue to notify our engineering staff of this issue. This development issue has an ID of 230226, and I have created you a private support case so that you can be notified when this issue is fixed. This case has an ID of CAS-179737-R9G8J9 and you can access it at https://ko.infragistics.com/my-account/support-activity.