Declined
Last Updated: 31 Oct 2023 13:36 by ADMIN
Colleen
Created on: 12 Oct 2023 05:47
Category: MultiColumnComboBox
Type: Bug Report
0
MultiColumnComboBox: Item is automatically changed when pressing the tab key to leave the control
Item is automatically changed when pressing the tab key to leave the control
1 comment
ADMIN
Vladimir Stoyanov
Posted on: 31 Oct 2023 13:36

When the dropdown of the RadMultiColumnComboBox is opened, pressing the Tab key will select the CurrentItem of the RadGridView element in its dropdown (by default the current item is the first one). This behavior is by design, since the control does not synchronize its current and selected item so that you can navigate with the arrow keys without changing the selection.

In order to avoid selecting an item in the RadMultiColumnComboBox when the tab key is pressed, you can clear the CurrentItem of the RadGridView inside the dropdown when it is opened (for example in the InitializeDropDownContentManager event) and call the CloseDropDown method of the RadMultiColumnComboBox when the Tab key is pressed (for example in the PreviewKeyDown event):

private void RadMultiColumnComboBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
    var mccb = sender as RadMultiColumnComboBox;

    if (mccb != null && e.Key == Key.Tab)
    {
        mccb.CloseDropDown();
    }
}

private void RadMultiColumnComboBox_InitializeDropDownContentManager(object sender, Telerik.Windows.Controls.MultiColumnComboBox.DropDownContentManagerEventArgs e)
{
    var mccb = sender as RadMultiColumnComboBox;
    var gridView = mccb.DropDownContentManager.DropDownElement as RadGridView;

    if (gridView != null)
    {
        gridView.CurrentItem = null;
    }
}

Regards,
Vladimir Stoyanov
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.