DataGridViewRowContextMenuStripNeededEventArgs.ContextMenuStrip Property

 
System_CAPS_noteNote

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

Gets or sets the shortcut menu for the row that raised the RowContextMenuStripNeeded event.

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

member ContextMenuStrip : ContextMenuStrip with get, set

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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: