Declined
Last Updated: 11 Sep 2018 12:02 by ADMIN
ADMIN
George
Created on: 06 Aug 2014 09:07
Category:
Type: Bug Report
3
FIX. RadMenu - Disabled items are selected but show no visual indication when navigating with the keyboard
To reproduce:

Add a RadMenu and a RadMenuItem. To the RadMenuItem add another items, make some of them disabled. Open the first menu item and navigate with the arrows, you will see that the disabled items are selected but no visually.

They should be skipped during navigation

Workaround:

Use the following custom RadMenuItem. The navigation logic is overriden in the RadDropDownMenu:

public class MyMenuItem : RadMenuItem
{
    public MyMenuItem()
        : base()
    {

    }

    public MyMenuItem(string text)
        : base(text)
    {
    }

    protected override RadDropDownMenu CreateDropDownMenu()
    {
        return new MyDropDown(this);
    }

    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadMenuItem);
        }
    }
}

public class MyDropDown : RadDropDownMenu
{
    public MyDropDown(RadElement owner)
        :base(owner)
    {
    }

    protected override bool ProcessUpDownNavigationKey(bool isUp)
{
    var selectedItem = this.GetSelectedItem();

    RadItem nextItem = selectedItem;

    var itemIndex = this.Items.IndexOf(selectedItem);
    for (int i = itemIndex; i < this.Items.Count - itemIndex; i++)
    {
        nextItem = this.GetNextItem(nextItem, !isUp);
        if (nextItem.Enabled)
        {
            break;
        }
    }

    this.SelectItem(nextItem);

    return true;
}


    public override string ThemeClassName
    {
        get
        {
            return typeof(RadDropDownMenu).FullName;
        }
        set
        {
        }
    }
}

1 comment
ADMIN
Peter
Posted on: 30 Sep 2014 08:57
We cannot set a visual indication for the current item when it is disabled, since Rad Themes cannot be applied to disabled items.