DataBinding to RadAutoCompleteBox

2 posts, 0 answers
  1. Brian
    Brian avatar
    1 posts
    Member since:
    Dec 2012

    Posted 04 Jan 2013 Link to this post

    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)
  2. Vladi
    Vladi avatar
    743 posts

    Posted 07 Jan 2013 Link to this post

    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.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top