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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Keeping a Combo Popup from closing when a checkbox is clicked.

Thread ID:

Created:

Updated:

Platform:

Replies:

18644 Sep 6,2004 12:40 PM UTC Sep 8,2004 08:13 PM UTC Windows Forms 3
loading
Tags: Tools
Raul Rosenthal
Asked On September 6, 2004 12:40 PM UTC

I derived a ComboBox of mine from ComboBoxExt and I am using a CheckedListBox a its ListControl. I decided to derive because I want the TextBox to display all the currently checked items separated by comma. Now I''d like to be able to check more than one item without having to press the dropdown button each time to show the listbox. I looked at the source code of the control, but could not find a way to trap the click on the checkboxes so that I could stop the popup window from closing up. It seems that the relevant methods are private and I can''t get at them. Can you help, please?

Administrator [Syncfusion]
Replied On September 8, 2004 01:11 AM UTC

Hi Raul, You could handle the ComboBoxExt''s DropDownCloseOnClick event set its Cancel property to true for this purpose. private void comboBoxExt1_DropDownCloseOnClick(object sender, Syncfusion.Windows.Forms.Tools.MouseClickCancelEventArgs args) { args.Cancel = true; } I have created a test sample as per your specifications above (i.e., allow multiple selections without closing the dropdown and all the selections are displayed in the Text with each item being separated by a comma), and have attached it here. Please refer to it and let me know if you need further assistance. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Raul Rosenthal
Replied On September 8, 2004 11:35 AM UTC

Hmm, I tried but it does not work very well. In your sample, all is fine, but you have to click twice on the checkboxes (the first click just selects the item) I prefer the derived class approach, because I need a bunch of controls and I''d rather prefer not to duplicate the code in the DropDownCloseOnClick event handler. I overrode GetPopupText and OnDropDownCloseOnClick. GetPopupText build a string with the checked items separated by comma. OnDropDownCloseOnClick is as follows: protected override void OnDropDownCloseOnClick(Syncfusion.Windows.Forms.Tools.MouseClickCancelEventArgs args) { args.Cancel = true; base.OnDropDownCloseOnClick( args ); Text = GetPopupText(); } I get the same behaviour as your sample regarding the need to click twice on the checkboxes. Moreover, when the code in OnDropDownCloseOnClick is executed the checkbox if not checked yet, so the Text field is not updated as expected.

Administrator [Syncfusion]
Replied On September 8, 2004 08:13 PM UTC

Hi Raul, Thanks for sharing your solution with us. Please let me know if you need any other information. We appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;