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

modifying SuggestionSource problem

2 Answers 55 Views
AutocompleteBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gary Blakely
Top achievements
Rank 1
Gary Blakely asked on 29 Jan 2012, 06:39 PM

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 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 30 Jan 2012, 09:13 AM
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 >>

0
Deyan
Telerik team
answered on 31 Jan 2012, 02:14 PM
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 >>

Tags
AutocompleteBox
Asked by
Gary Blakely
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or