I would like to put in a menu and in a toolbar a ComboBoxTool which is populated with values taken from an enumeration. That's easy to achieve and there are several examples in the documentation online.
Instead of showing the combobox items with the value itself (myValue.ToString()) or with a display text for each of the values in the enumeration, my request is to show only an icon or an image for each item in the ValueItemsList, in both the cases, when the combobox is closed and when it's dropped down.
Do I need to use DrawFilter/CreationFilter to get such appearance?
Another idea could be to encapsulate an UltraCombo or an UltraComboEditor in the WinToolbars menu or the toolbar through the wrapping mechanism of the ControlContainerTool, but I fear that the tool inside would suffer the container overhead to open it, and it won't work as the basic ComboBoxTool.
I thought even to use a StateButton for each item of the enumeration, but StateButton is intended to being shown always with the rest of the controls of the group it belongs to, but that isn't a valid alternative. The combobox behaviour is just what I need for my purposes:
- you see a small area which exploits only the icon of the selected item- you click the small area to show the full list of the icons/images - you make another click to choose another selection and newer selected image becomes the appearance of the small area after the dropdown menu returns hidden.
Hello,
Thank you for contacting Infragistics Developer Support.
What you can do to have only images in your ComboBoxTool is to use the ValueListItems appearance object of the ValueList of the ComboBoxTool and use empty strings for their text. This way only the image will appear in your combo box.
I have attached a sample which demonstrates this approach. Please take a look at it and let me know if this is the appearance of the ComboBoxTool you seek. If you want something else, please attach a screenshot with the desired result.
I am waiting for your response.
Just perfect! I have already coded my implementation in Visual Basic .NET and I understood something new about the WinToolbars.
Thank you very much.