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.

BUG?: Unable to preserve checked state in ComboBoxBase when binding DataTable to CheckedListBox.

Thread ID:

Created:

Updated:

Platform:

Replies:

17865 Aug 18,2004 02:02 PM Aug 23,2004 01:59 PM Windows Forms 4
loading
Tags: Tools
W. Cedeno
Asked On August 18, 2004 02:02 PM

I have a ComboBoxBase control that uses a CheckedListBox to display a list of items to the user. The CheckedListBox is populated from a DataTable using the DataSource, DisplayMember, and ValueMember properties. When the ComboBoxBase DropDown is closed, the checked items are reset. The next time the DropDown is opened there are not checked items. How could we force the ComboBoxBase to preserve the state of the CheckedListBox.

Administrator [Syncfusion]
Replied On August 18, 2004 04:58 PM

Hi Cedeno, Thanks for bringing this to our attention. I have created a test sample as per your specifications and could observe this behavior here. I will further investigate this issue and get back to you as soon as soon as possible. We appreciate your patience and cooperation. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On August 20, 2004 01:12 PM

Hi Cedeno, The ComboBoxBase does not keep track of the CheckState of the items in the CheckedListBox (which gets reset everytime the popup is hidden and shown). It only keeps track of the popup-control''s Text property and hence the text is correctly retained. So if you wish to retain the CheckState of the items in the CheckedListBox, it has to be done explicitly by handling the ComboBoxBase.PopupContainer''s BeforePopup and CloseUp events as shown below : this.comboBoxBase1.PopupContainer.BeforePopup += new CancelEventHandler(ComboBoxBase_BeforePopup); this.comboBoxBase1.PopupContainer.CloseUp += new PopupClosedEventHandler(ComboBoxBase_CloseUp); ArrayList arr = new ArrayList(); private void ComboBoxBase_BeforePopup(object sender, CancelEventArgs args) { for (int i=0; iearlier application here that shows how this can be done. Please refer to it and let me know if this works for you. Thanks for your patience, and we appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Walter Cedeno
Replied On August 23, 2004 01:46 PM

Thank you for the workaround. I guess this is necessary when binding to a DataSource. The ComboBoxBaseDemo sample code uses the CheckedListBox with items entered at design time and it behaves as expected. Thanks, Walter

Administrator [Syncfusion]
Replied On August 23, 2004 01:59 PM

Hi Walter, Thanks for the update. Please let us know if you need any other information. We appreciate your 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.

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.

;