• RaymondC
  • Advanced Member Topic Starter
Is it possible to disable the ability to "Group By This Column" from the header context menu for selected columns?



Edit: Is it possible to disable "Group By This Column" from the header context menu for the entire grid?
There is no way to prohibit only this command.

If you wish to disable the whole column header context menu (for some or all columns), you can use the HeaderRightClick event for that.

To disable all built-in context menus in the grid, set the BuiltinContextMenus property to False.
If your users can group iGrid only using its column header context menu, here is a trick possible in the v6.0:

Private Sub iGrid1_ContextMenuPopup(ByVal eContextMenu As iGrid600_10Tec.EContextMenuSource, ByVal lRowIfAny As Long, ByVal lColIfAny As Long, bCancel As Boolean, bHideDefaultItems As Boolean)

   If eContextMenu = igContextMenuColHeader Then

      iGrid1.AllowGrouping = (lColIfAny <> 3)

   End If

End Sub

We prohibit grouping only for the 3rd column in the above code.