Unplanned
Last Updated: 12 Apr 2023 16:57 by ADMIN
Dimitar
Created on: 29 Jul 2019 14:47
Category: AutoCompleteBox
Type: Feature Request
8
AutoCompleteBox: Allow item highlighting when deleting text
While typing, if there's a matching item - it's being highlighted. However, when deleting text, no item gets highlighted even if there is a match.
2 comments
ADMIN
Stenly
Posted on: 12 Apr 2023 16:57

Hello Julio,

Thank you for sharing with us a possible way for achieving this functionality.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Julio
Posted on: 12 Apr 2023 16:47

sharing my solution as it would have take me less time to figure out if someone would have posted a work around here:

 

 public class myBox: RadAutoCompleteBox
    {
        public myBox() :base()
        {
            this.KeyUp += OnKeyUp;
        }

        private void OnKeyUp(object sender, KeyEventArgs e)
        {
            if (this.IsDropDownOpen)
            {
                int index = this.HighlightBehavior.FindHighlightedIndex(this.SearchText, this.FilteredItems.OfType<object>().ToList(), this.SelectedItems.OfType<object>().ToList(), this.TextSearchPath, this.TextSearchMode);
                this.Dispatcher.Invoke(() => { if(this.HighlightedIndex != index) this.HighlightedIndex = index; },    System.Windows.Threading.DispatcherPriority.ApplicationIdle);

            }
        }
    }