DataGridViewRowContextMenuStripNeededEventArgs::RowIndex Property
.NET Framework (current version)
Gets the index of the row that is requesting a shortcut menu.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Int32The zero-based index of the row that is requesting a shortcut menu.
Use this property to retrieve additional information about the 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: