Unplanned
Last Updated: 19 Jun 2017 10:57 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 21 Apr 2017 05:51
Category: GridView
Type: Bug Report
1
FIX. RadGridView - RadShortcut for the relevant grid is not executed in a MDI child
Please refer to the attached sample project and follow the steps in the gif file.

1. Open two MDI child forms.
2. Activate the first form and right click on the grid in order to show the context menu and add a shortcut to the menu item. Press Ctrl+N in order to add some new rows to the first grid.
3. Activate the second form and right click on the grid in order to show the context menu and add a shortcut to the menu item. Press Ctrl+N in order to add some new rows to the second grid. However, you will notice that the first several shortcuts combinations are executed for the first grid and then for the active second grid.

Workaround:  clear the shortcut when the form is deactivated:
this.Deactivate += GridForm_Deactivate;

private void GridForm_Deactivate(object sender, EventArgs e)
{
    item.Shortcuts.Clear();
}

private void GridForm_Activated(object sender, EventArgs e)
{
    this.ActiveControl = this.radGridView1;
}
RadMenuItem item = new RadMenuItem();
private void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
{

    item.Text = "insert row";
    item.Shortcuts.Add(new RadShortcut(Keys.Control, Keys.N));
    item.Click += item_Click;
    e.ContextMenu.Items.Add(item);
}
0 comments