Blazor DataGrid Example - Context Menu
Order ID Press Enter to sort | Customer ID Press Enter to sort | Order Date Press Enter to sort | Freight Press Enter to sort | Ship Country Press Enter to sort |
|---|
| 10001 | ALFKI | 5/15/1991 | $2.30 | Denmark |
| 10002 | ANATR | 4/4/1990 | $3.30 | Brazil |
| 10003 | ANTON | 11/30/1957 | $4.30 | Germany |
| 10004 | BLONP | 10/22/1930 | $5.30 | Austria |
| 10005 | BOLID | 2/18/1953 | $6.30 | Switzerland |
| 10006 | ALFKI | 5/15/1991 | $4.60 | Denmark |
| 10007 | ANATR | 4/4/1990 | $6.60 | Brazil |
| 10008 | ANTON | 11/30/1957 | $8.60 | Germany |
| 10009 | BLONP | 10/22/1930 | $10.60 | Austria |
| 10010 | BOLID | 2/18/1953 | $12.60 | Switzerland |
| 10011 | ALFKI | 5/15/1991 | $6.90 | Denmark |
| 10012 | ANATR | 4/4/1990 | $9.90 | Brazil |
This sample demonstrates the DataGrid context menu feature that appears on right-click actions.
Right-click anywhere on the Blazor DataGrid to display the context menu with available operations. Configure the context menu items by setting the ContextMenuItems property to predefined options. Menu items are displayed based on their target context.
The available default context menu items are:
- Edit - Edit the current record.
- Delete - Delete the current record.
- Save - Save the edited record.
- Cancel - Cancel the editing state.
- Copy - Copy the selected records to clipboard.
- PdfExport - Export the DataGrid to PDF format.
- ExcelExport - Export the DataGrid to Excel format.
- CsvExport - Export the DataGrid to CSV format.
- SortAscending - Sort the current column in ascending order.
- SortDescending - Sort the current column in descending order.
- FirstPage - Navigate to the first page.
- PrevPage - Navigate to the previous page.
- LastPage - Navigate to the last page.
- NextPage - Navigate to the next page.
In this demo, the context menu is enabled with the default set of items.
For more detailed information about the context menu feature, refer to the context menu documentation.