Autocomplete is not working

3 posts, 0 answers
  1. Tony
    Tony avatar
    111 posts
    Member since:
    May 2011

    Posted 16 Apr 2012 Link to this post

    I have a RadComboBox on a form in my WPF application:

    <telerik:RadComboBox BorderBrush="{DynamicResource ControlBorder}"
                         CanAutocompleteSelectItems="True"
                         Focusable="True"
                         FontSize="18"
                         FontWeight="Bold"
                         Foreground="{DynamicResource TextForeground}"
                         Height="32"
                         HorizontalAlignment="Left"
                         IsEditable="True"
                         IsFilteringEnabled="True"
                         IsTextSearchCaseSensitive="False"
                         IsTextSearchEnabled="True"
                         ItemsSource="{Binding Path=RecentUsers, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type c:LoginForm}}}"
                         Name="UsersName"
                         TabIndex="1"
                         Width="300" />

    In my code-behind, I have declared a DependencyProperty called RecentUsersProperty:

    public static readonly DependencyProperty RecentUsersProperty =
        DependencyProperty.Register( "RecentUsers", typeof( string[] ), typeof( LoginForm ), new PropertyMetadata( null ) );
      
    public string[] RecentUsers {
        get { return (string[]) GetValue( RecentUsersProperty ); }
        set { SetValue( RecentUsersProperty, value ); }
    }

    In the Loaded event handler of the window that contains this field, I set the RecentUsers to an array of strings retrieved from the database:

    RecentUsers = DataInterface.GetRecentUsers( 90 );

    Here's the data that's returned by the call to GetRecentUsers:

    "adam.st.onge@eoc4.elsagrd.com"
    "chris.theet"
    "jklepacz1"
    "nwhaley"
    "rcass"
    "tonyb"
    "tony.vitabile"

    When the window is displayed and I start typing the name of a user that is in the RecentUsers array, autocomplete does not fill in the rest of the matching name.  If I tab out of the field, though, it selects the first one that matches. 

    What am I doing wrong?  I'm using the 2012.1.326.40 version of the Telerik libraries.

    Tony
  2. George
    Admin
    George avatar
    1332 posts

    Posted 17 Apr 2012 Link to this post

    Hi Tony,


    I would suggest removing the IsFilteringEnabled="True" property for the RadComboBox control. For more information about autocompleting and filtering, please refer to our help -  

    Hope this helps.


    Regards,
    George
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Tony
    Tony avatar
    111 posts
    Member since:
    May 2011

    Posted 17 Apr 2012 Link to this post

    George:

    Thank you, that did it!

    Tony
Back to Top