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

DataBinding to RadAutoCompleteBox

1 Answer 412 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 04 Jan 2013, 05:37 PM
Is there a way to get the current Text of the RadAutoCompletBox?  It appears to me that you currently need to bind to both SearchText and Selected Item which doesn't feel right to me.  Here is an example of my xaml

<telerik:RadAutoCompleteBox SelectionMode="Single" 
                                    ItemsSource="{Binding Items}" 
                                    SearchText="{Binding SearchText, Mode=TwoWay}" 
                                    SelectedItem="{Binding SelectedItem, Mode=TwoWay}" />

Items is just a List<string>

Say for instance we are looking for the string "telerik".  I type in "te" then hit tab key, the autocompletebox text is telerik.. however if i look at the SearchText it is just "te" and the SelectedItem is telerik.  Which leads me to have to check if SelectedItem is null then use SearchText else use SelectedItem.  Am i missing something here?  Seems like i should be able to just bind to the Text.

I am currently using RadControls for WPF v.2012.1224.40 (Dev)

1 Answer, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 07 Jan 2013, 01:21 PM
Hello Brian,

Thank you for contacting us.

In the current version of RadAutoCompleteBox you can access the typed text from the SearchText property and the auto completed text from the SelectedItem property of the control.

There is an existing issue concerning the SearchText property of the control that we are aware of which is causing the need to access the auto completed text from the SelectedItem property. We logged it in our Public Issue Tracker System where you can vote for it and track its status.

We will do our best to have a permanent fix for it in our next official Q1 2013 release of RadControls.

We apologize for any inconvenience that this may be causing.

Greetings,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
AutoCompleteBox
Asked by
Brian
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or