Context Menu in ASP.NET Core Spreadsheet

23 Mar 20212 minutes to read

Context Menu is used to improve user interaction with Spreadsheet using popup menu. This will open when right clicking on Cell/Column Header/Row Header/ Pager in Spreadsheet. You can use enable-context-menu property to enable/disable context menu.

Default Context Menu items

Please find the below table for default context menu items and its actions.

Section
Context Menu items
Action
Row Cell
Cut
Cut the selected cells content to the clipboard, so that you can paste it somewhere else.
Copy
Copy the selected cells content to the clipboard, so that you can paste it to somewhere else.
Paste
Paste the content from clipboard to spreadsheet.
Insert
Insert new cells or rows or columns to worksheet.
Delete
Delete existing cells or rows or columns from worksheet.
Sort
Perform sorting to the selected range of cells by ascending or descending.
Filter
Perform filtering to the selected cells based an active cell's value or active cell's color.
Hyperlink
Create a link in the spreadsheet for quick access to webpages or worksheet reference.
Comment
Add a note or extra information about the active cell.
Format Cells
Apply number format to the selected cells.
Clear Contents
Delete the contents in the selected cells.
Row Header / Column Header
Cut
Cut the selected cells content to the clipboard, so that you can paste it to somewhere else.
Copy
Copy the selected cells content to the clipboard, so that you can paste it to somewhere else.
Paste
Paste the content from clipboard to spreadsheet.
Clear Contents
Delete the contents in the selected cells.
Insert
Insert new cells or rows or columns to worksheet.
Delete
Delete existing cells or rows or columns from worksheet.
Hide
Hide the selected columns / rows.
Unhide
Unhide the selected columns / rows.
Pager
Insert
Insert new worksheet to spreadsheet.
Delete
Delete the selected worksheet from spreadsheet.
Move or copy
Opens move or copy dialog to move worksheet or to create duplicate worksheet.
Rename
Rename the selected worksheet.
Protect Sheet
Prevent unwanted changes from others by limiting their ability to edit.
Hide
Hide the selected worksheet.
Unhide
Opens unhide dialog to unhide worksheet.

The following code example describes the above behavior.

  • HTML
  • <ej-spread-sheet id="Spreadsheet" enable-context-menu ="true"></ej-spread-sheet>

    Context Menu at cell

    Contextmenu at Cell

    Context Menu at column header

    Contextmenu at Column Header

    Context Menu at row header

    Contextmenu at Row Header

    Context Menu at pager

    Contextmenu at Pager