Preserving CheckedItems with RadDataBoundListBox bound to a AutoCompleteBox

2 posts, 0 answers
  1. Aneesh
    Aneesh avatar
    1 posts
    Member since:
    Oct 2013

    Posted 31 Mar 2014 Link to this post

    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.
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 02 Apr 2014 Link to this post

    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.

     
  3. DevCraft banner
Back to Top