DataGridViewHeaderCell.GetInheritedContextMenuStrip(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the shortcut menu of the header cell.
public:
override System::Windows::Forms::ContextMenuStrip ^ GetInheritedContextMenuStrip(int rowIndex);
public override System.Windows.Forms.ContextMenuStrip GetInheritedContextMenuStrip (int rowIndex);
public override System.Windows.Forms.ContextMenuStrip? GetInheritedContextMenuStrip (int rowIndex);
override this.GetInheritedContextMenuStrip : int -> System.Windows.Forms.ContextMenuStrip
Public Overrides Function GetInheritedContextMenuStrip (rowIndex As Integer) As ContextMenuStrip
Parameters
- rowIndex
- Int32
Ignored by this implementation.
Returns
A ContextMenuStrip if the DataGridViewHeaderCell or DataGridView has a shortcut menu assigned; otherwise, null
.
Remarks
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
.