I have a ComboBoxTool with a ValueList containing items with images. When a ValueListItem is selected, I would like to prevent the image from being displayed in the EditorWithTextUIElement that represents the SelectedItem.
Any thoughts about how to accomplish this? Basically, I would like to do something similar to what is accomplished by the FontListTool, where each item in the dropdown contains an image on the left-hand side, but once an item is selected, the caption for it is shown without the image.
Thanks!
Hi,
Thank you for posting to our forums.
You can achieve this functionality by using the Creation Filter interface. With its help you can remove the ImageUIElement inside the EditorWithText and then expand the text element. For more information on this interface, please visit this link:
http://help.infragistics.com/Help/Doc/WinForms/2012.2/CLR4.0/html/Win_Creation_Filter.html
I have attached a sample which demonstrates this suggestion.
Please let me know if you have any additional question.
Thank you so much. This is a big improvement, and the end result is much closer to what I am looking for. Actually, it is perfect when the DropDownStyle is set to DropDownList. The only issue is that when the DropDownStyle is set to DropDown, the image is restored until you exit edit mode.
Any additional help you can provide would be tremendous. DropDownList is really not appropriate for me to use in this scenario. I attempted to port the code in the CustomCreationFilter to the AfterToolEnterEditMode event handler, but it seems that the appropriate UIElement is different when edit mode is entered on a ComboBoxTool with the DropDownStyle set to DropDown.
Thanks again for your prompt response.
Hi Kevin,
Thank you for the reply.
Unfortunately when the tool is in edit mode, it shows a TextBox for editing and you can’t control the position of this TextBox. The only thing you can do in this case is to remove the image, but there will be an empty space instead of the image. What I would suggest in this case is to log a product idea for this from our product ideas site http://ideas.infragistics.com.
Please let me know if you have any additional questions.