Example of Context Menu in Blazor DataGrid Component

DataGrid / Miscellaneous / Context Menu

This example shows how to use the context menu in the DataGrid component. To access the context menu, right-click anywhere on the DataGrid.

1 of 7 pages (75 items)

When you right-click on the Blazor DataGrid, you can choose to display the context menu. To configure the items in the context menu, set the ContextMenuItems property to either default or custom. Each item will be displayed in accordance with its target. The following are the default context menu items:

  • 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 DataGrid as PDF file format.
  • ExcelExport - Export the DataGrid as Excel file format.
  • CsvExport - Export the DataGrid as CSV file 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.

The context menu feature is enabled in this demo by setting the ContextMenuItems property to the default items.

More information about the Context menu feature can be found in this documentation section.

Transform your Blazor web apps today with Syncfusion® Blazor components
100+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE