Hi
I have a Winforms project, in which I have an UltraComboEditor. Some of the items that are represented in the UltraComboEditor are marked in a special way, to indicate that they are not in use. This is done when populating the items of the UltraComboEditor like so:
if (/*Some condition*/) { comboTrees.Items[index].Appearance.ForeColor = SystemColors.InactiveCaptionText; comboTrees.Items[index].Appearance.FontData.Strikeout = DefaultableBoolean.True; }
This gives a nice indication when the list is dropped down. Now, when an item is selected, I would like to keep that formatting, if it was not in use.
SubjectTree1, which is not in use, was selected - but when selected, it is not possible to see that it is not in use.
The only way I can achieve this is by setting the appearance for the entire UltraComboBox, making it look like all the items are not in use. Is there a way to only format the SelectedItem of an UltraComboEditor?
Best regards
Lars
Hi Lars,
The ComboEditor will not pick up the appearance of the text of the selected item. But it will pick up the image. So if you applied an image to each ValueListItem and used an image to indicate which ones are not in use, then that image would display when that item is selected.
Another option, of course, is to trap when the selected item changes and apply an appearance to the control's edit area.
Hi Mike,
Thanks for your reply! We use this indication (with the strikeout and fontcolor) other places in the application when items are not in use, so adding images is not an option at the moment.
I am already handling the ValueChanged event of the ComboEditor to update other parts of the screen, so it would be natural to update the editor here as well. Can you tell me how to retrieve the edit area of the control? I have looked at the "ComboEditor.Editor" property, but there doesn't seem to be any options to alter the appearance.
Best regards,