diff --git a/src/Eto.Mac/Forms/Controls/GridHandler.cs b/src/Eto.Mac/Forms/Controls/GridHandler.cs index 4d4b1ad0e9..71ad92b28f 100644 --- a/src/Eto.Mac/Forms/Controls/GridHandler.cs +++ b/src/Eto.Mac/Forms/Controls/GridHandler.cs @@ -415,7 +415,7 @@ public bool ShowHeader { if (value && Control.HeaderView == null) { - Control.HeaderView = headerView = new EtoTableHeaderView { Handler = this }; + Control.HeaderView = headerView = new EtoTableHeaderView { Handler = this, Menu = ContextMenu.ToNS() }; } else if (!value && Control.HeaderView != null) { @@ -437,7 +437,8 @@ public virtual ContextMenu ContextMenu { Widget.Properties.Set(GridHandler.ContextMenu_Key, value); Control.Menu = value.ToNS(); - Control.HeaderView.Menu = value.ToNS(); + if (Control.HeaderView != null) + Control.HeaderView.Menu = value.ToNS(); } }