Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Collapse]Spreadsheet
   [Expand]Product Information
    Product Structure
    Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Spreadsheet Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
    Data Grouping
   [Expand]Pivot Table Overview
   [Expand]Charting Overview
    Printing
    Events
   [Expand]Mail Merge Overview
    Protection
    Find and Replace
   [Collapse]Visual Elements
     Workbook
     Worksheet
    [Expand]Cells and Cell Ranges
     Rows and Columns
     Formulas
     Name Box
     Pictures
     Pop-Up Menus
    [Expand]Dialogs
    Services
   [Expand]Shortcuts
   [Expand]Examples
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Pop-Up Menus

The Spreadsheet has several types of context (pop-up) menus which are invoked when the user clicks different visual objects. The SpreadsheetControl provides the SpreadsheetControl.PopupMenuShowing event which allows you to customize context menus by adding or removing items.

Expanded Context Menus Overview

Menu Type Appearance Description
SpreadsheetMenuType.AutoFilter Specifies a context menu which can be invoked by clicking the AutoFilter drop-down arrow.
SpreadsheetMenuType.Cell Specifies a context menu which can be invoked by right-clicking any cell in a worksheet.
SpreadsheetMenuType.Chart Specifies a context menu which can be invoked by right-clicking a chart in a worksheet.
SpreadsheetMenuType.ColumnHeading Specifies a context menu which can be invoked by right-clicking a column header.
SpreadsheetMenuType.DrawingObjects Specifies a context menu which can be invoked by right-clicking a drawing object when a worksheet contains several drawing objects, such as pictures or charts.
SpreadsheetMenuType.Picture Specifies a context menu which can be invoked by right-clicking a picture embedded in a worksheet.
SpreadsheetMenuType.PivotTable Specifies a context menu which can be invoked by right-clicking any cell in a pivot table.
SpreadsheetMenuType.PivotTableAutoFilter Specifies a context menu which can be invoked by clicking the AutoFilter drop-down arrow on the row or column label of a pivot table.
SpreadsheetMenuType.RowHeading Specifies a context menu which can be invoked by right-clicking a row header.
SpreadsheetMenuType.SelectAllButton Specifies a context menu which can be invoked by right-clicking the Select All button in the upper-left corner of a worksheet.
SpreadsheetMenuType.SheetTab Specifies a context menu which can be invoked by right-clicking a worksheet tab.

Expanded Customizing Context Menus in Code

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4978.

This example demonstrates how to customize the SpreadsheetControl's context menu. In particular, this sample demonstrates how to remove or disable the existing items of the context menu and add new menu items.

Handle the SpreadsheetControl.PopupMenuShowing event to change specific items of the SpreadsheetControl's popup menu every time it is invoked. The current menu can be accessed via the Menu property of the event parameter.

All context menu types are listed in the SpreadsheetMenuType enumeration. The following code modifies the SpreadsheetMenuType.Cell menu, which can be invoked by right-clicking any cell on a worksheet.

Expanded See Also

How would you rate this topic?​​​​​​​