DataGridViewHeaderCell.GetInheritedContextMenuStrip Method (Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the shortcut menu of the header cell.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public override ContextMenuStrip GetInheritedContextMenuStrip(
	int rowIndex


Type: System.Int32

Ignored by this implementation.

Return Value

Type: System.Windows.Forms.ContextMenuStrip

A ContextMenuStrip if the DataGridViewHeaderCell or DataGridView has a shortcut menu assigned; otherwise, null.

If the DataGridViewHeaderCell does not have a shortcut menu, the DataGridViewHeaderCell will inherit the shortcut menu from the DataGridView. If the DataGridView also does not have a shortcut menu, then the GetInheritedContextMenuStrip method will return null.

.NET Framework
Available since 2.0
Return to top