Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
17259
Set text for multi select ComboBoxTool
posted

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

Parents
  • 4219
    Verified Answer
    posted

    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

Reply Children