Completed
Last Updated: 13 Apr 2016 13:11 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 03 Jul 2014 11:24
Category:
Type: Bug Report
0
FIX. RadApplicationMenu - the popup is closed when clicking the RadMenuComboItem.ComboBoxElement.EditableElement
To reproduce:

RadMenuItem item = new RadMenuItem();
item.Text = "Item1";    

RadMenuComboItem comboItem = new RadMenuComboItem();
comboItem.ComboBoxElement.DropDownStyle = RadDropDownStyle.DropDownList; 
comboItem.Items.Add("meters");
comboItem.Items.Add("feet");         
item.Items.Add(comboItem);
this.radApplicationMenu1.Items.Add(item);


The undesired behavior is illustrated better in the attached file.

Workaround:

item.DropDownClosing += item_DropDownClosing;
comboItem.ComboBoxElement.EditableElement.MouseDown += EditableElement_MouseDown;
comboItem.ComboBoxElement.EditableElement.MouseUp += EditableElement_MouseUp;

bool shouldCancel = false;

private void EditableElement_MouseUp(object sender, MouseEventArgs e)
{
    shouldCancel = false;
}

private void EditableElement_MouseDown(object sender, MouseEventArgs e)
{
    shouldCancel = true;
}

private void item_DropDownClosing(object sender, RadPopupClosingEventArgs args)
{
    args.Cancel = shouldCancel;
}

private void ComboBoxElement_SelectedIndexChanged(object sender, PositionChangedEventArgs e)
{
    RadDropDownListElement ddle = sender as RadDropDownListElement;
    if (ddle != null && e.Position < ddle.Items.Count)
    {
        RadMessageBox.Show(ddle.Items[e.Position].Text);
    }
}
Attached Files:
0 comments