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

[Solved] How do I set an initial value and get a new value back?

2 Answers 55 Views
AutoCompleteBox for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marc
Top achievements
Rank 1
Marc asked on 08 Jun 2013, 05:27 PM
I feel like I'm missing something obvious here...
I am trying to use the autocomplete box to search a list of items (categories in one case). It is part of an editor -- I'm showing a recipe that has a list of categories it belongs to. When tapping on a category, I want to use the autocomplete box to show the item that they've tapped on and allow them to change it. I've got the possible items bound properly, proven by the fact that when I start typing, I get a list of items that match. My issue is that I'm drawing a blank on how to tell the control what the existing value is and how to get the new value back when one is selected. A pointer in the right direction would be much appreciated.

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander
Telerik team
answered on 10 Jun 2013, 12:44 PM
Hi Marc,

Thank you for contacting us.

I am not completely sure what is the scenario that you are having trouble with -- by "tapping on a category" do you mean to tap onto the AutoCompleteBox, and if yes -- what do you expect to happen?

If I understand you correctly you would like to pre-set the value of the RadAutoCompleteBox -- you can use the RadAutoCompleteBox.Text property to achieve the desired effect. Also, you can hook up the RadAutoCompleteBox.SelectionChanged event to track when the selection of the control changes. 

Let me know if this helps.


Regards,
Alexander
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Marc
Top achievements
Rank 1
answered on 11 Jun 2013, 01:28 AM
Hello Alexander,
Oh good grief, I am an idiot. I was thinking in terms of binding an object to the control and never thought about binding a property of that object and listening for an event for the "return trip". Thanks!

--Marc
Tags
AutoCompleteBox for XAML
Asked by
Marc
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Marc
Top achievements
Rank 1
Share this question
or