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.
ADAdministrator Syncfusion Team August 18, 2004 04:58 PM
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.
ADAdministrator Syncfusion Team August 20, 2004 01:12 PM
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.
WCWalter CedenoAugust 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.
ADAdministrator Syncfusion Team August 23, 2004 01:59 PM
Thanks for the update. Please let us know if you need any other information. We appreciate your interest in Syncfusion products.