Accessibility in Blazor DataGrid
The Blazor DataGrid is built to support widely accepted accessibility standards. These standards help ensure that the component is usable by individuals with varying abilities, including those using assistive technologies.
Supported guidelines include:
- Americans with Disabilities Act (ADA)
- Section 508
- Web Content Accessibility Guidelines (WCAG) 2.2
- ARIA roles for semantic structure and screen reader compatibility
| Accessibility Criteria | Compatibility | Description |
|---|---|---|
| WCAG 2.2 Support | AA | Supports most WCAG 2.2 guidelines, such as color contrast (1.4.3) and keyboard accessibility (2.1.1), with some limitations in complex interactions. |
| Section 508 Support | ![]() |
Complies with most Section 508 requirements, with minor gaps in advanced interactive elements. |
| Screen Reader Support | ![]() |
Implements ARIA roles (e.g., role="grid", aria-label) for compatibility with screen readers like JAWS and NVDA. |
| Right-To-Left Support | ![]() |
Supports right-to-left (RTL) layouts for languages like Arabic and Hebrew using the EnableRtl property. |
| Color Contrast | ![]() |
Meets WCAG 2.2 minimum contrast ratios for text and visual elements. |
| Mobile Device Support | ![]() |
Ensures touch-based navigation and compatibility with mobile screen readers. |
| Keyboard Navigation Support | ![]() |
Supports standard keyboard interactions (e.g., Tab, Arrow keys), with limitations in some advanced features like filtering. |
| Axe-core Accessibility Validation | ![]() |
Passes most Axe-core checks, with minor issues in specific ARIA configurations. |
Support Level Indicators:
- All features meet the accessibility requirement.
- Some features meet the requirement; others may need improvement.
- The feature does not meet the requirement.WAI-ARIA attributes
The Blazor DataGrid implements the WAI-ARIA grid pattern to support accessibility requirements. This ensures compatibility with assistive technologies such as screen readers, including JAWS and NVDA. WAI-ARIA (Web Accessibility Initiative – Accessible Rich Internet Applications) attributes define roles, states, and properties that make the Blazor DataGrid accessible to individuals with disabilities.
| Attribute | Purpose |
|---|---|
role=grid |
Identifies the element as a grid container. |
role=row |
Defines a row containing cells within the grid. |
role=rowgroup |
Groups multiple rows, such as in grouped or hierarchical grids. |
role=columnheader |
Specifies a header cell providing column information. |
role=gridcell |
Indicates a data cell within the grid. |
role=button |
Represents interactive elements that function as buttons. |
role=search |
Identifies search regions, such as in the toolbar. |
role=presentation |
Hides elements from assistive technologies when not relevant. |
role=navigation |
Defines pager elements for page navigation. |
aria-colindex |
Specifies the column index relative to the total number of columns. |
aria-rowindex |
Specifies the row index relative to the total number of rows. |
aria-rowspan |
Indicates the number of rows spanned by a cell. |
aria-colspan |
Indicates the number of columns spanned by a cell. |
aria-selected |
Indicates the selection state of rows or cells. |
aria-expanded |
Shows whether expand/collapse icons are expanded in hierarchical or grouped grids. |
aria-sort |
Indicates sorting order (ascending or descending) for columns. |
aria-owns |
Defines relationships between elements for visual or functional context. |
aria-hidden |
Hides elements from assistive technologies. |
aria-labelledby |
Provides accessible names for elements like checkboxes in filters or dialogs. |
aria-describedby |
Describes features enabled in a header cell when it receives focus. |
The Blazor Data Grid uses a two-table structure for header and content. ARIA roles and attributes are applied to parent and child elements to enhance screen reader support. This structure may trigger warnings in automated accessibility tools, but it does not affect how screen readers interpret the content.
Accessibility checker tools may report the following known issues:
- aria-required-children: Appears when rendering the Blazor Data Grid without certain features or when toolbar and grouping are enabled. Ensure required child roles are present and suppress false positives if the structure is intentional.
- color-contrast: Can occur when the search item is enabled in the toolbar. Adjust theme variables or apply custom CSS to meet WCAG 2.2 AA contrast requirements.
- Invalid explicit ARIA roles on <tr>, <th>, <td>: These warnings result from applying roles like row, columnheader, and gridcell to support assistive technologies. Confirm that navigation remains functional and document exceptions for audits.
- Role inheritance conflicts (role=”button” with rowgroup descendants): May appear when toolbar cells contain buttons. Maintain DOM hierarchy and verify focus order manually.
- Content not within a landmark element: Add page-level landmarks (<header>, <main>, <nav>) to scope interactive regions.
- Multiple elements with role=”search” lacking unique labels: Assign unique aria-label or aria-labelledby attributes to each search region.
- Text contrast 4.10: Improve contrast ratio to at least 4.5:1 using CSS for standard text.
- Blazor Data Grid lacks a programmatic name: Set aria-label or aria-labelledby on the main Blazor Data Grid container.
- role=”rowgroup” not owned by a grid: Ensure grouped content remains within the element that has role=”grid”.
To improve accessibility, apply page landmarks, assign unique labels to search regions, and verify that color contrast meets WCAG 2.2 AA standards. When customizing styles, maintain visible focus indicators and a logical focus order.
Keyboard interaction
The Blazor Data Grid supports keyboard navigation based on the ARIA grid keyboard interaction guidelines. This enables efficient navigation for scenarios involving keyboard input or assistive technologies.
The supported keyboard shortcuts are listed below.
Pager
| Windows | Mac | Actions |
|---|---|---|
| Tab | Tab | Move focus to the next pager item. |
| Shift + Tab | ⇧ + Tab | Move focus to the previous pager item. |
| Enter / Space | Enter / Space | Select the currently focused page. |
| PageUp / ← | ← | Navigate to the previous page. |
| PageDown / → | → | Navigate to the next page. |
| Home / Ctrl + Alt + PageUp | Fn + ← | Navigate to the first page. |
| End / Ctrl + Alt + PageDown | Fn + → | Navigate to the last page. |
Virtualization
| Windows | Mac | Actions |
|---|---|---|
| Page Up | Page Up | Scrolls up by one viewport while keeping the focused row in the same relative position. |
| Page Down | Page Down | Scrolls down by one viewport while keeping the focused row in the same relative position. |
| Ctrl + ↑ | ⌘ + ↑ | Moves focus to the first row of the current column. |
| Ctrl + ↓ | ⌘ + ↓ | Moves focus to the last row of the current column. |
Note: These keyboard shortcuts apply only when virtualization is enabled via the
EnableVirtualizationproperty. These shortcuts have no effect when virtualization is disabled.
Focus Elements
| Windows | Mac | Actions |
|---|---|---|
| Home | Fn + ← | Move focus to the first cell of the focused row. |
| End | Fn + → | Move focus to the last cell of the focused row. |
| Ctrl + Home | ⌘ + Fn + ← | Move focus to the first cell of the first row in the Blazor DataTable. |
| Ctrl + End | ⌘ + Fn + → | Move focus to the last cell of the last row in the Blazor DataTable. |
| ↑ | ↑ | Move the cell focus up from the focused cell. |
| ↓ | ↓ | Move the cell focus down from the focused cell. |
| → | → | Move the cell focus right from the focused cell. |
| ← | ← | Move the cell focus left from the focused cell. |
| Alt + J | ⌥ + J | Move focus to the Blazor Data Grid. |
| Alt + W | ⌥ + W | Move focus to the Blazor Data Grid content element. |
Selection
| Windows | Mac | Actions |
|---|---|---|
| ↑ | ↑ | Move the row/cell selection up. |
| ↓ | ↓ | Move the row/cell selection down. |
| → | → | Move the cell selection right. |
| ← | ← | Move the cell selection left. |
| Shift + ↑ | ⇧ + ↑ | Extend the row/cell selection upward. |
| Shift + ↓ | ⇧ + ↓ | Extend the row/cell selection downward. |
| Shift + → | ⇧ + → | Extend the cell selection to the right. |
| Shift + ← | ⇧ + ← | Extend the cell selection to the left. |
| Enter | Enter | Move the row/cell selection down. |
| Shift + Enter | ⇧ + Enter | Move the row/cell selection up. |
| Esc | Esc | Deselect all selected rows/cells. |
| Ctrl + A | ⌘ + A | Select all rows/cells on the current page. |
Grouping
| Windows | Mac | Actions |
|---|---|---|
| Ctrl + ↑ | ⌘ + ↑ | Collapse all visible groups. |
| Ctrl + ↓ | ⌘ + ↓ | Expand all visible groups. |
| Ctrl + Space | ⌘ + Space | Group by the focused header column. |
| Alt + ↑ | ⌥ + ↑ | Collapse the selected group. |
| Alt + ↓ | ⌥ + ↓ | Expand the selected group. |
| Windows | Mac | Actions |
|---|---|---|
| Ctrl + P | ⌘ + P | Print the Blazor Data Grid. |
Clipboard
| Windows | Mac | Actions |
|---|---|---|
| Ctrl + C | ⌘ + C | Copy selected rows or cells to the clipboard. |
| Ctrl + Shift + H | ⌘ + ⇧ + H | Copy selected rows or cells with headers to the clipboard. |
Editing
| Windows | Mac | Actions |
|---|---|---|
| F2 | F2 | Start editing the selected row (Normal/Dialog) or the selected cell (Batch). |
| Enter | Enter | Save the form (Normal/Dialog) or save the current cell and start editing the next row cell (Batch). |
| Insert | ⌥ + Enter | Create a new add form based on the NewRowPosition. |
| Delete | Delete | Delete the selected record. |
| Tab | Tab | Navigate to the next editable cell (Normal/Dialog) or save the current cell and start editing the next cell (Batch). |
| Shift + Tab | ⇧ + Tab | Navigate to the previous editable cell (Normal/Dialog) or save the current cell and start editing the previous cell (Batch). |
| Shift + Enter | ⇧ + Enter | Save the current cell and start editing the previous row cell (Batch). |
Filtering
| Windows | Mac | Actions |
|---|---|---|
| Alt + ↓ | ⌥ + ↓ | Open the filter menu (Excel, menu, or checkbox) when its header is focused. |
Column Menu
| Windows | Mac | Actions |
|---|---|---|
| Alt + ↓ | Alt + ↓ | Open the column menu when its header is focused. |
Reordering
| Windows | Mac | Actions |
|---|---|---|
| Ctrl + ← / → | ⌘ + ← / → | Reorder the focused header column to the left or right. |
Sorting
| Windows | Mac | Actions |
|———————————————–|——————————————–|———————————————————|
| Ctrl + ← / → | ⌘ + ← / → | Reorder the focused header column to the left or right. |
On Mac devices, the Command and Control keys can be interchanged based on system settings. When this switch is active, use the Command key in place of Control, and Control in place of Command for keyboard interactions.
For example:
- To group columns when a header is focused, use Command + Space.
- To expand visible groups, use Ctrl + Down Arrow.
Custom Keyboard Navigation
Custom keyboard navigation in the Syncfusion® Blazor DataGrid changes the keys used to run grid actions, such as navigation, sorting, grouping, editing, and copying. A default shortcut can be replaced with a new key combination, or a default keyboard action can be disabled. Actions without a custom setting keep the default shortcuts.
To customize keyboard shortcuts, assign a GridCustomKeyboardShortcuts object to the KeyboardShortcuts property of the SfGrid component. Shortcuts can be configured for actions in the DataCell, Header, EditCell, GroupRow, DetailRow, and Common categories. Each category matches the grid area where the action runs.
| Category | Grid area |
|---|---|
| DataCell | Focused data cells. |
| Header | Focused header cells. |
| EditCell | Cells in edit mode. |
| GroupRow | Focused group caption rows. |
| DetailRow | Focused rows with a detail template. |
| Common | Grid-wide actions, such as print, copy, and paste. |
Default keyboard shortcuts
The following tables list the actions in each category and the default shortcuts.
DataCell
| Action | Windows | Mac | Description |
|---|---|---|---|
| NavigateUp | Shift + Enter | ⇧ + Enter | Move focus to the cell above. |
| NavigateDown | Enter / ↓ / Shift + ↓ | Enter / ↓ / ⇧ + ↓ | Move focus to the cell below. |
| NavigateLeft | Shift + Tab | ⇧ + Tab | Move focus to the previous cell. |
| NavigateRight | Tab / → / Shift + → | Tab / → / ⇧ + → | Move focus to the next cell. |
| NavigateRowStart | Home | Fn + ← | Move focus to the first cell in the current row. |
| NavigateRowEnd | End | Fn + → | Move focus to the last cell in the current row. |
| NavigateGridStart | Ctrl + Home | ⌘ + Fn + ← | Move focus to the first cell in the grid. |
| NavigateGridEnd | Ctrl + End | ⌘ + Fn + → | Move focus to the last cell in the grid. |
| StartEdit | F2 | F2 | Begin editing the focused cell. |
| AddRecord | Insert | ⌥ + Enter | Add a new row. |
| DeleteRecord | Delete | Delete | Delete the focused row or selected rows. |
| SelectAll | Ctrl + A | ⌘ + A | Select all rows. |
| PageUp | PageUp | PageUp | Move to the previous page. |
| PageDown | PageDown | PageDown | Move to the next page. |
| SelectToggle | Space | Space | Select or clear the focused checkbox row. |
| Undo | Ctrl + Z | ⌘ + Z | Undo the last edit operation. |
| Redo | Ctrl + Y | ⌘ + ⇧ + Z | Redo the last undone operation. |
Header
| Action | Windows | Mac | Description |
|---|---|---|---|
| SortColumn | Enter / Ctrl + Enter | Enter / ⌘ + Enter | Sort the focused column. |
| ToggleHeaderCheckbox | Space | Space | Select or clear all rows using the header checkbox. |
| MoveFocusToFirstRow | Alt + W | ⌥ + W | Move focus to the first data row. |
| NavigateLeft | Shift + Tab | ⇧ + Tab | Move focus to the previous header cell. |
| NavigateRight | Tab | Tab | Move focus to the next header cell. |
| GroupColumn | Ctrl + Space | ⌘ + Space | Group or ungroup the focused column. |
| ReorderColumnLeft | Ctrl + ← | ⌘ + ← | Move the focused column to the left. |
| ReorderColumnRight | Ctrl + → | ⌘ + → | Move the focused column to the right. |
| FocusFilterBar | ↓ | ↓ | Move focus to the filter bar. |
| OpenColumnMenu | Alt + ↓ | ⌥ + ↓ | Open the column menu. |
| OpenFilterMenu | Alt + ↓ | ⌥ + ↓ | Open the filter menu for the focused column. |
EditCell
| Action | Windows | Mac | Description |
|---|---|---|---|
| Escape | Escape | Escape | Cancel the current edit. |
| EditEndAndTabNext | Tab | Tab | Save the edit and move to the next editable cell. |
| EditEndAndShiftTabPrev | Shift + Tab | ⇧ + Tab | Save the edit and move to the previous editable cell. |
GroupRow
| Action | Windows | Mac | Description |
|---|---|---|---|
| ExpandGroup | → | → | Expand the focused group. |
| CollapseGroup | ← | ← | Collapse the focused group. |
| ExpandAllGroup | Ctrl + ↓ | ⌘ + ↓ | Expand all groups. |
| CollapseAllGroup | Ctrl + ↑ | ⌘ + ↑ | Collapse all groups. |
DetailRow
| Action | Windows | Mac | Description |
|---|---|---|---|
| ExpandDetailRow | Enter / Alt + ↓ | Enter / ⌥ + ↓ | Expand the focused detail row. |
| CollapseDetailRow | Enter / Alt + ↑ | Enter / ⌥ + ↑ | Collapse the focused detail row. |
| ExpandAllDetailRows | Ctrl + ↓ | ⌘ + ↓ | Expand all detail rows. |
| CollapseAllDetailRows | Ctrl + ↑ | ⌘ + ↑ | Collapse all detail rows. |
Common
| Action | Windows | Mac | Description |
|---|---|---|---|
| Ctrl + P | ⌘ + P | Open the browser print dialog. | |
| Copy | Ctrl + C | ⌘ + C | Copy selected cells to the clipboard. |
| CopyWithHeaders | Ctrl + Shift + H | ⌘ + ⇧ + H | Copy selected cells along with the column headers. |
| Paste | Ctrl + V | ⌘ + V | Paste clipboard content into the grid. |
Assign custom keyboard shortcuts
The GridCustomKeyboardShortcuts object contains one dictionary for each category, such as Header or DataCell. Each dictionary maps a GridKeyboardAction value to a key combination string, such as "Alt+S" or "Ctrl+Shift+H". When the mapped keys are pressed in the matching grid area, the DataGrid runs the mapped action.
@using Syncfusion.Blazor.Grids
<SfGrid DataSource="@GridData"
AllowPaging="true"
AllowSorting="true"
AllowGrouping="true"
AllowReordering="true"
AllowSelection="true"
AllowFiltering="true"
Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })"
KeyboardShortcuts="@Shortcuts"
Height="400">
<GridEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true" Mode="EditMode.Batch"></GridEditSettings>
<GridFilterSettings Type="FilterType.Menu"></GridFilterSettings>
<GridColumns>
<GridColumn Type="ColumnType.CheckBox" Width="50"></GridColumn>
<GridColumn Field="@nameof(OrderData.OrderID)" HeaderText="Order ID" IsPrimaryKey="true" Width="120" />
<GridColumn Field="@nameof(OrderData.CustomerID)" HeaderText="Customer Name" Width="150" />
<GridColumn Field="@nameof(OrderData.ShipCity)" HeaderText="Ship City" Width="120" />
<GridColumn Field="@nameof(OrderData.OrderDate)" HeaderText="Order Date" Format="d" Width="140" />
<GridColumn Field="@nameof(OrderData.ShipName)" HeaderText="Ship Name" Width="160" />
</GridColumns>
</SfGrid>
@code {
public List<OrderData> GridData { get; set; }
protected override void OnInitialized()
{
GridData = OrderData.GetAllRecords();
}
private GridCustomKeyboardShortcuts Shortcuts { get; } = new()
{
Header = new Dictionary<GridKeyboardAction, string>
{
{ GridKeyboardAction.NavigateLeft, "Alt+J" },
{ GridKeyboardAction.NavigateRight, "Alt+L" },
{ GridKeyboardAction.SortColumn, "Alt+S" },
{ GridKeyboardAction.GroupColumn, "Alt+G" },
{ GridKeyboardAction.ReorderColumnLeft, "Ctrl+J" },
{ GridKeyboardAction.ReorderColumnRight, "Ctrl+L" },
{ GridKeyboardAction.ToggleHeaderCheckbox, "Alt+H" },
{ GridKeyboardAction.MoveFocusToFirstRow, "Alt+R" },
{ GridKeyboardAction.OpenColumnMenu, "Alt+M" },
{ GridKeyboardAction.OpenFilterMenu, "Ctrl+F" }
},
DataCell = new Dictionary<GridKeyboardAction, string>
{
{ GridKeyboardAction.NavigateUp, "Alt+I" },
{ GridKeyboardAction.NavigateDown, "Alt+K" },
{ GridKeyboardAction.NavigateLeft, "Alt+J" },
{ GridKeyboardAction.NavigateRight, "Alt+L" },
{ GridKeyboardAction.NavigateRowStart, "Alt+U" },
{ GridKeyboardAction.NavigateRowEnd, "Alt+O" },
{ GridKeyboardAction.NavigateGridStart, "Ctrl+U" },
{ GridKeyboardAction.NavigateGridEnd, "Ctrl+O" },
{ GridKeyboardAction.StartEdit, "Alt+E" },
{ GridKeyboardAction.AddRecord, "Alt+A" },
{ GridKeyboardAction.DeleteRecord, "Alt+D" },
},
GroupRow = new Dictionary<GridKeyboardAction, string>
{
{ GridKeyboardAction.ExpandGroup, "Alt+C" },
{ GridKeyboardAction.CollapseGroup, "Alt+V" },
{ GridKeyboardAction.ExpandAllGroup, "Ctrl+C" },
{ GridKeyboardAction.CollapseAllGroup, "Ctrl+V" }
},
EditCell = new Dictionary<GridKeyboardAction, string>
{
{ GridKeyboardAction.Escape, "Alt+B" }
},
Common = new Dictionary<GridKeyboardAction, string>
{
{ GridKeyboardAction.Copy, "Ctrl+U" },
{ GridKeyboardAction.CopyWithHeaders, "Ctrl+I" },
}
};
}public class OrderData
{
public static List<OrderData> Orders = new List<OrderData>();
public OrderData() { }
public OrderData(int? OrderID, string CustomerID, string ShipCity, string ShipName, DateTime? OrderDate)
{
this.OrderID = OrderID;
this.CustomerID = CustomerID;
this.ShipCity = ShipCity;
this.ShipName = ShipName;
this.OrderDate = OrderDate;
}
public static List<OrderData> GetAllRecords()
{
if (Orders.Count() == 0)
{
int OrderID = 10247;
for (int i = 1; i < 2; i++)
{
Orders.Add(new OrderData(OrderID + 1, "VINET", "Reims", "Vins et alcools Chevali", new DateTime(2026, 1, 1)));
Orders.Add(new OrderData(OrderID + 2, "TOMSP", "Münster", "Toms Spezialitäten", new DateTime(2026, 1, 2)));
Orders.Add(new OrderData(OrderID + 3, "HANAR", "Rio de Janeiro", "Hanari Carnes", new DateTime(2026, 1, 3)));
Orders.Add(new OrderData(OrderID + 4, "VICTE", "Lyon", "Victuailles en stock", new DateTime(2026, 1, 4)));
Orders.Add(new OrderData(OrderID + 5, "SUPRD", "Charleroi", "Suprêmes délices", new DateTime(2026, 1, 5)));
Orders.Add(new OrderData(OrderID + 6, "HANAR", "Lyon", "Hanari Carnes", new DateTime(2026, 1, 6)));
Orders.Add(new OrderData(OrderID + 7, "CHOPS", "Rio de Janeiro", "Chop-suey Chinese", new DateTime(2026, 1, 7)));
Orders.Add(new OrderData(OrderID + 8, "ERNSH", "Münster", "Richter Supermarkt", new DateTime(2026, 1, 8)));
Orders.Add(new OrderData(OrderID + 9, "WELLI", "Reims", "Wellington Import", new DateTime(2026, 1, 9)));
OrderID += 9;
}
}
return Orders;
}
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public string ShipCity { get; set; }
public string ShipName { get; set; }
public DateTime? OrderDate { get; set; }
}A single action can respond to more than one key combination. For example, the
NavigateDownaction in the DataCell category responds to Enter, ↓, and Shift + ↓ by default.
Disable default keyboard actions
Disabling a default keyboard action stops the action from running when the default keys are pressed. To disable an action, map the matching GridKeyboardAction value to string.Empty in the category dictionary.
The following example disables the default sorting and grouping shortcuts in the Header category.
| Action | Default shortcut (Windows) | Default shortcut (Mac) | Result |
|---|---|---|---|
GridKeyboardAction.SortColumn |
Enter / Ctrl + Enter | Enter / ⌘ + Enter | Sorting from a focused header cell is disabled. |
GridKeyboardAction.GroupColumn |
Ctrl + Space | ⌘ + Space | Grouping from a focused header cell is disabled. |
Other header shortcuts, such as navigation, column reordering, and opening the filter menu, continue to use the default keys.
@using Syncfusion.Blazor.Grids
<SfGrid DataSource="@GridData"
AllowPaging="true"
AllowSorting="true"
AllowGrouping="true"
AllowReordering="true"
AllowSelection="true"
AllowFiltering="true"
@ref="Grid"
Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })"
KeyboardShortcuts="@Shortcuts"
Height="400">
<GridEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></GridEditSettings>
<GridFilterSettings Type="FilterType.Menu"></GridFilterSettings>
<GridSelectionSettings CheckboxOnly="true"></GridSelectionSettings>
<GridColumns>
<GridColumn Type="ColumnType.CheckBox" Width="50"></GridColumn>
<GridColumn Field="@nameof(OrderData.OrderID)" HeaderText="Order ID" IsPrimaryKey="true" Width="120" />
<GridColumn Field="@nameof(OrderData.CustomerID)" HeaderText="Customer Name" Width="150" />
<GridColumn Field="@nameof(OrderData.ShipCity)" HeaderText="Ship City" Width="120" />
<GridColumn Field="@nameof(OrderData.OrderDate)" HeaderText="Order Date" Format="d" Width="140" />
<GridColumn Field="@nameof(OrderData.ShipName)" HeaderText="Ship Name" Width="160" />
</GridColumns>
</SfGrid>
@code {
private SfGrid<OrderData> Grid { get; set; } = default!;
public List<OrderData> GridData { get; set; }
protected override void OnInitialized()
{
GridData = OrderData.GetAllRecords();
}
private GridCustomKeyboardShortcuts Shortcuts { get; } = new()
{
Header = new Dictionary<GridKeyboardAction, string>
{
{ GridKeyboardAction.SortColumn, string.Empty },
{ GridKeyboardAction.GroupColumn, string.Empty }
}
};
}public class OrderData
{
public static List<OrderData> Orders = new List<OrderData>();
public OrderData() { }
public OrderData(int? OrderID, string CustomerID, string ShipCity, string ShipName, DateTime? OrderDate)
{
this.OrderID = OrderID;
this.CustomerID = CustomerID;
this.ShipCity = ShipCity;
this.ShipName = ShipName;
this.OrderDate = OrderDate;
}
public static List<OrderData> GetAllRecords()
{
if (Orders.Count() == 0)
{
int OrderID = 10247;
for (int i = 1; i < 2; i++)
{
Orders.Add(new OrderData(OrderID + 1, "VINET", "Reims", "Vins et alcools Chevali", new DateTime(2026, 1, 1)));
Orders.Add(new OrderData(OrderID + 2, "TOMSP", "Münster", "Toms Spezialitäten", new DateTime(2026, 1, 2)));
Orders.Add(new OrderData(OrderID + 3, "HANAR", "Rio de Janeiro", "Hanari Carnes", new DateTime(2026, 1, 3)));
Orders.Add(new OrderData(OrderID + 4, "VICTE", "Lyon", "Victuailles en stock", new DateTime(2026, 1, 4)));
Orders.Add(new OrderData(OrderID + 5, "SUPRD", "Charleroi", "Suprêmes délices", new DateTime(2026, 1, 5)));
Orders.Add(new OrderData(OrderID + 6, "HANAR", "Lyon", "Hanari Carnes", new DateTime(2026, 1, 6)));
Orders.Add(new OrderData(OrderID + 7, "CHOPS", "Rio de Janeiro", "Chop-suey Chinese", new DateTime(2026, 1, 7)));
Orders.Add(new OrderData(OrderID + 8, "ERNSH", "Münster", "Richter Supermarkt", new DateTime(2026, 1, 8)));
Orders.Add(new OrderData(OrderID + 9, "WELLI", "Reims", "Wellington Import", new DateTime(2026, 1, 9)));
OrderID += 9;
}
}
return Orders;
}
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public string ShipCity { get; set; }
public string ShipName { get; set; }
public DateTime? OrderDate { get; set; }
}Ensuring accessibility
The Blazor DataGrid is validated for accessibility using axe-core integrated with Playwright tests.
Accessibility compliance can be evaluated using the interactive sample, which demonstrates the Blazor Data Grid’s behavior with accessibility tools and validation steps.
