none
How to add non-selectable items into a combobox

    Question

  • I'm trying to achieve a parent/child layout in a combo box drop down where the parent items are not selectable and the child items are.

    Colors

              blue

              red

              white

     

    In the above example, if the user clicks on the parent item 'Colors' the drop down list will remain open as the item cannot be selected.

    I know this is possible via MFC by subclassing the listbox control. Is it possible in Windows Forms (C#)?

    Tuesday, August 01, 2006 1:08 PM

All replies

  • Hi,

    The post discusses how to disable the item in the listbox, hope it helps in some extent. Or you can implement the DropDown event and do not show the item you don't need.

    Tuesday, August 08, 2006 2:47 AM