Skip to content

Latest commit

 

History

History
59 lines (50 loc) · 1.73 KB

kb-autocompletebox-scroll-with-page-up-down.md

File metadata and controls

59 lines (50 loc) · 1.73 KB
title description type page_title slug position tags ticketid res_type
How to Scroll Multiple Items with Page Up and Down
An article explaining how to enable the scrolling of an arbitrary number of items.
how-to
Allow Scrolling of an Arbitrary Number of Items with Page Up and Page Down
kb-autocompletebox-scroll-with-page-up-down
0
autocompletebox, scroll, multiple, number, items, page, up, down
1479153
kb

Environment

Product Version 2020.3.817
Product RadAutoCompleteBox for WPF

Description

How to enable the scrolling of multiple items using the Page Up and Page Down keys.

Solution

As of version 2020.3.817 the RadAutoCompleteBox exposes a protected HighlightedIndex property which can be used to set the highlighted item. This property can be used in the HandleKeyDown method of the control to enable [custom keyboard navigation]({%slug radautocompletebox-features-keyboard-support%}) with the Page Up and Page Down keys.

[C#]

{{region cs-kb-autocompletebox-scroll-with-page-up-down-0}} public class CustomAutoCompleteBox : RadAutoCompleteBox { protected override bool HandleKeyDown(Key systemKey) { if (systemKey == Key.PageDown) { this.HighlightedIndex += 10; return true; }

        if (systemKey == Key.PageUp)
        {
            this.HighlightedIndex -= 10;
            return true;
        }

        return base.HandleKeyDown(systemKey);
    }
}

{{endregion}}

See Also

  • [Keyboard Support]({%slug radautocompletebox-features-keyboard-support%})