Selection disabled on left click

2 posts, 0 answers
  1. Jeremy
    Jeremy avatar
    2 posts
    Member since:
    Apr 2015

    Posted 10 Jul 2015 Link to this post

    Hy Team !
    I am showing the DropDown menu on focus with this code :

    private void RadAutoCompleteBox_GotFocus(object sender, RoutedEventArgs e)
            {
                var autoComplete = (RadAutoCompleteBox)sender;
                string searchText = autoComplete.SearchText;
                if (autoComplete.SelectedItem != null)
                {
                    searchText = BindingExpressionHelper.GetValue(autoComplete.SelectedItem, autoComplete.DisplayMemberPath).ToString();
                }
                autoComplete.Populate(searchText);
            }

     

    This works but it also disable the left click when I try to select something from this list. Every other way are working (right click, keyboard control, ...) just the left click doesn't.

    So what can I do to fix this issue ?

  2. Nasko
    Admin
    Nasko avatar
    586 posts

    Posted 13 Jul 2015 Link to this post

    Hello Jeremy,

    The observed by you behavior of RadAutoCompleteBox could be observed when the control is not populated correctly. When the Populate method gets called you need first to check whether the DropDown is not opened:
    private void radAutoCompleteBox1_GotFocus(object sender, RoutedEventArgs e)
    {
        var radAutoCompleteBox = sender as RadAutoCompleteBox;
        if (!radAutoCompleteBox.IsDropDownOpen)
        {
            radAutoCompleteBox.Populate(radAutoCompleteBox.SearchText);
        }
    }

    Please, check the proposed above approach and let us know if it resolves your issue.

    Hopes this helps.

    Regards,
    Nasko
    Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top