silverlight combobox - highlight a few items in the popup list
I'm wondering if I can m开发者_运维技巧ake fake sections in the popup menu: The rule would be, if the 5th character of the displayed item is different from the 5th char of the previous item in the menu, it has to be highlighted What do you think? Thanks!
To achieve this would be a hack.
Normally the items that appear in the popup part of a combo box will be an instantiated data template, and each gets its own data item and has no clue or knowledge of the other items in the list, so you couldn't use a converter or anything else to achieve this behavior.
What you could do though is inject (attach) your own control into the popup part of the combo box, and take over the rendering of the data items. How you do this will depend upon which combo box you are using (i.e. MS or some other vendor's) and would be a whole new question.
Would that be easier if I were to create my own combobox as follow: a TextBox associated with a Button that when pushed would popup a datagrid in which I could implement this conditional formatting?
精彩评论