DataGridViewRowContextMenuStripNeededEventArgs::ContextMenuStrip Property
.NET Framework (current version)
Gets or sets the shortcut menu for the row that raised the RowContextMenuStripNeeded event.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: property ContextMenuStrip^ ContextMenuStrip { ContextMenuStrip^ get(); void set(ContextMenuStrip^ value); }
This property initially contains the value of the DataGridViewRow::ContextMenuStrip property if it has been set for a row.
The following code example handles the RowContextMenuStripNeeded event to provide a ContextMenuStrip based on the title of the employee. In this example, there are two shortcut menus, one for managers and one for all other employees. This example is part of a larger example available in the DataGridViewRowContextMenuStripNeededEventArgs class overview.
.NET Framework
Available since 2.0
Available since 2.0
Show: