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

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

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.

4 Replies

AD Administrator Syncfusion Team August 18, 2004 08:58 PM UTC

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.


AD Administrator Syncfusion Team August 20, 2004 05:12 PM UTC

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.


WC Walter Cedeno August 23, 2004 05:46 PM UTC

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


AD Administrator Syncfusion Team August 23, 2004 05:59 PM UTC

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.

Loader.
Live Chat Icon For mobile
Up arrow icon