This is a migrated thread and some comments may be shown as answers.

Preserving CheckedItems with RadDataBoundListBox bound to a AutoCompleteBox

1 Answer 49 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aneesh
Top achievements
Rank 1
Aneesh asked on 31 Mar 2014, 04:03 PM
I have a RadDataBoundListBox bound to a AutoCompleteBox. The list box is in checked mode. The autocompletebox acts as a filter for the list. Suppose i check the first item in the list, and change the text in the autocompletebox. The items in the list also change accordingly. However, the the item that i checked becomes unchecked. Is there any efficient way to preserve the CheckedItems list?
  
I tried declaring a object of Telerik.Windows.Controls.CheckedItemsCollection(Of Object) and assigning it the value of radDataBoundListBox.CheckedItems every time the ItemCheckedStateChanged is fired. And then adding each item from that list to CheckedItems when the AutoCompleteBox TextChanged event is fired, but it didn't work.

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 02 Apr 2014, 12:20 PM
Hi Aneesh,

Thanks for writing.

In your scenario each time the filtered suggestions from RadAutoCompleteBox are changed a new data source is generated and assigned to the list box control. It is the expected behavior not to have the previously checked items checked again.

A possible approach to solving this is to store some kind of information about the items that were previously checked in a separate collection and use it to explicitly check items when the filtered suggestions are changed.

I hope this helps.

Regards,
Deyan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DataBoundListBox
Asked by
Aneesh
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or