Completed
Last Updated: 28 Jul 2022 07:58 by ADMIN
Release R3 (LIB 2022.2.711)
Suresh
Created on: 27 Jun 2022 05:42
Category: UI for WinForms
Type: Bug Report
1
RadRibbonBar: Application hangs when pressing down arrow and all menu items are disabled in RadDropDownButton

Please run the attached sample project, open the drop down and press the down arrow key.

Observed: application hangs

Expected: since all menu items in the drop down are disabled, nothing is expected to happen. However, the application shouldn't hangs.

Workaround:

public class CustomRadDropDownButtonElement : RadDropDownButtonElement
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadDropDownButtonElement);
        }
    }
    protected override RadDropDownButtonPopup CreateDropDown()
    {
        return new CustomDropDown(this);
    }
}

public class CustomDropDown : RadDropDownButtonPopup
{
    public CustomDropDown(RadElement ownerElement) : base(ownerElement)
    {
    }

    protected override void EnsureItemEnabled(RadItem item, bool isUp)
    {
        do
        {
            item = this.GetNextItem(item, !isUp);
            if (item == this.Items.Last())
            {
                break;
            }

        } while (!item.Enabled);
        if (item != null)
        {

            this.SelectItem(item);
        }
    }
}

0 comments