We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ComboBoxBarItem prevent drop down from closing

Hi, Is there any way to prevent the drop down from closing when a user clicks on an item in the drop down? I want to be able to specify some of the items in the drop down list to be non-selectable. I previously did this by using a custom ListBox and overriding OnMouseUp in the listbox, not calling the base if the last item selected was a non-selectable, but this no longer works. Thanks, Sue

5 Replies

AD Administrator Syncfusion Team August 11, 2005 04:58 PM UTC

Hi Sue, I am afraid there is no way to prevent the ComboBox drop down from closing.However,you can set the item to be non-selectable by setting the SelectedIndex of that item to -1.I have attached a test sample that illustrates this.Let me know if this meets your requirement. Regards, Guru Patwal Syncfusion, Inc.


SH Sue Harris August 11, 2005 11:51 PM UTC

Hi Guru, Nice try, but not quite what I wanted. I basically am trying to have a tree in the combo box drop list and some items collapse and expand that tree when you click on them. Is it likely that this sort of functionality (preventing the drop down close) will be available in future? Or the ability to tell the combo box to drop down? Regards, Sue


AD Administrator Syncfusion Team August 15, 2005 01:40 AM UTC

Hi Sue, The ComboBoxbarItem can only host a ListControl like ListBox or display items in its ChoiceList collection. It cannot host controls in its dropdown. The XPMenus framework has a specialized BarItem - DropDownBarItem for this purpose. This can have a PopupControlContainer in its dropdown, which in turn can host other controls. Are you referring to the DropDownBarItem here ? Please let us know about this. We appreciate your cooperation. Regards, Guru Patwal Syncfusion, Inc.


SH Sue Harris August 15, 2005 04:31 AM UTC

Hi Guru, No I was actually using the ComboBoxbarItem with a custom ListBox in which I drew my tree (it was a very simplified tree just the expand markers and indentation levels which were draw in the DrawItem event). I''ll have a look at the DropDownBarItem to see if I can use it instead (will it allow me to control when it closes?) Regards, Sue


AD Administrator Syncfusion Team August 15, 2005 02:03 PM UTC

Hi Sue, The PopupControlContainer has the HidePopup and ShowPopup methods that will allow you to hide/show itself. But the PopupControlContainer will automatically close when a node is collapsed/expanded in the TreeView that it is hosting. We intend to add a cancelable BeforeCloseUp event to the PopupControlContainer, that would allow you conditionally close or cancel closing of the PopupControlContainer. Feature Request #357 - Add a cancelable BeforeCloseUp event to the PopupControlContainer We will try our very best to implement this feature at the earliest. We appreciate your patience, and thanks for your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon