ContextMenuStrip Property
Collapse the table of content
Expand the table of content

DataGridViewCellContextMenuStripNeededEventArgs.ContextMenuStrip Property


Gets or sets the shortcut menu for the cell that raised the CellContextMenuStripNeeded event.

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

public ContextMenuStrip ContextMenuStrip { get; set; }

Property Value

Type: System.Windows.Forms.ContextMenuStrip

The ContextMenuStrip for the cell.

This property initially contains the value of the DataGridViewCell.ContextMenuStrip property if it has been set for a cell.

The following code example demonstrates an event handler that uses the ContextMenuStrip property to set the shortcut menu for a cell.

Snippet section 22 of code snippet {"project_id":"3fedad16-eaf1-41a6-8f96-0c1949c68f32","entity_id":"49b2de81-d65a-4b0a-9253-be7b8cf9c59d","entity_type":"CodeSnippet","locale":"en-US"} in source file ({"filename":"/CS/sharedrows.cs","blob_type":"Source","blob_id":"-002fcs-002fsharedrows-002ecs","blob_revision":3}) overlaps with other snippet sections. Ensure the tags are placed correctly.

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft