I'm trying to add some a custom menu item when the user clicks on a GridColumnGroupCellElement to hide all columns below this group. However, the Group property of the GridColumnGroupCellElement is always null and the ColumnIndex is -1. Is there any way to determine the GridViewColumn or GroupViewColumnGroup that this element belongs to?
This is the code i'm currently using
Thank you,
Tim
This is the code i'm currently using
private void Grid_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e) |
{ |
if (e.ContextMenuProvider.GetType() == typeof(GridColumnGroupCellElement)) |
{ |
GridColumnGroupCellElement element = (GridColumnGroupCellElement)e.ContextMenuProvider; |
GridViewColumnGroup group = element.Group; // this is always null |
RadMenuItem customItem = new RadMenuItem("Hide Group", "HideGroup"); |
customItem.Tag = group; |
customItem.Click += new EventHandler(Grid_ContextMenu_HideGroup_Click); |
e.ContextMenu.Items.Add(customItem); |
} |
} |
Thank you,
Tim