I added a ComboBoxTool in my toolbar with checkboxes. Usually the combobox text is the display string of the selected item.
When you use checkboxes, there could be a situation where the selected item is not checked at all, so I tried to set the text manually with:
comboBox.Text = string.Join(",", comboBox.ValueList.CheckedItems.Select(i => i.DisplayText).ToArray());
However, this code doesn't work. Although there is a set to the Text property, it stays the same and always shows the text of the selected item.
Is there a way to do that?
Thanks
Hi Amiram,
You can try to set the DropDownStyle to DropDown. Please try the same code with DropDown style, otherwise you would be able to set the value of the comboBoxTool to something in the valuelist.
Let me know if I can help you with something more.
Regards,
Stefaniya
Yes it helps, thank you. How can I limit the text entered to be in the value list?
I can suggest you to use the ToolValueChanged event of the comboBoxTool or of the ultraToolbarsManager and perform checking over the combobox text. This event would fire on every change made in the combobox’s text.
I hope this is helpful for you.