modifying SuggestionSource problem

3 posts, 0 answers
  1. Gary Blakely
    Gary Blakely avatar
    63 posts
    Member since:
    Jan 2010

    Posted 29 Jan 2012 Link to this post

    I'm using RadControls_for_WindowsPhone_2011_3_1316_DEV_hotfix...

    once I assign a List using myAutoCompleteBox.SuggestionSource, modification of the contents of List does not get reflected during execution of the program.

    I have tried re-assigning the List as the SuggestionSource but that does not work.

    What do I have to do to get the AutoCompleteBox to reflect the modified contents?

    Thanks, Dean

  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 30 Jan 2012 Link to this post

    Hi Gary,

    Thanks for writing and for reporting this issue.

    Could you please give us some further details on what type of collection you are using as a source? If you are using a INotifyCollectionChanged implementation and still experience issues I would kindly like to ask you to send us a demo project that we can use to reproduce the case and see what causes the undesired behavior.

    Regards,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 31 Jan 2012 Link to this post

    Hi Gary,

    We have received an e-mail which you have sent to a no reply email account that is used to notify you about a received response in our online ticketing system related to this ticket.

    Your response is as follows:

    " Deyan,

    I'm not using INotifyCollectionChanged collection nor am I binding in xaml.  I am setting SuggestionSource to a List<string> in c# code.  When I update the List<string> with a new entry, it is not reflected in the AutoComplete box - not until the program runs again.  There must be something I can do to "refresh" the control so that it sees the revised List.

    My app is not some "hello world" app that can use static binding against a datasource.  I need to dynamically change sources in code.  for instance, sometimes depending on the language being used as in a translator app.

    Dean "

    Before moving on to the topic, I would kindly like to ask you to use our support ticketing system to get back to us since otherwise it might happen that we do not notice your response.

    Back to your case: in the .NET framework there are some patterns related to scenarios where you are using a collection as a source for a control and would like the control to track the changes in the collection. You can either use the ObservableCollection<T> class (http://msdn.microsoft.com/en-us/library/ms668604.aspx) or simply implement the INotifyCollectionChanged interface in your collection. RadAutoCompleteBox itself knows this interface and will handle any changes in the source collection in case this collection implements it. Since RadAutoCompleteBox internally uses a special approach to optimize the filtering process, it does not directly use the source collection, but it stores a sorted version of it in an internal collection. Therefore, it is essential to provide a INotifyCollectionChanged implementation in case you would like your collection changes be tracked.

    I hope this helps.

    Regards,

    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top