Example of Context Menu in ASP.NET MVC Data Grid Control

This sample demonstrates the usage of context menu in Grid component. Right click anywhere on the Grid to view context menu.

DEMO
SOURCE

Grid has options to show the context menu when right click on it. To configure the items in context menu, you should define either default or custom item in ContextMenuItems. Each item will be shown based on it target. The default items are

  • Edit - Edit the current record.
  • Delete - Delete the current record.
  • Save - Save the edited record.
  • Cancel - Cancel the edited state.
  • Copy - Copy the selected records.
  • PdfExport - Export the grid as Pdf format.
  • ExcelExport - Export the grid as Excel format.
  • CsvExport - Export the grid as CSV format.
  • SortAscending - Sort the current column in ascending order.
  • SortDescending - Sort the current column in descending order.
  • FirstPage - Go to the first page.
  • PrevPage - Go to the previous page.
  • LastPage - Go to the last page.
  • NextPage - Go to the next page.

While using the Grid in a touch device environment, touch and hold the Grid row cell to show the context menu.

In this demo, Context Menu feature has enabled by defining the ContextMenuItems property with all default items.

Transform your ASP.NET MVC web apps today with Syncfusion ASP.NET MVC components
85+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE
opens in a new tab