Blazor DataGrid Example - Row and Column Spanning
Employee ID Press Enter to sort. Press Alt Down to open filter Menu | Employee Name Press Enter to sort. Press Alt Down to open filter Menu | 9:00 AM Press Enter to sort. Press Alt Down to open filter Menu | 9:30 AM Press Enter to sort. Press Alt Down to open filter Menu | 10:00 AM Press Enter to sort. Press Alt Down to open filter Menu | 10:30 AM Press Enter to sort. Press Alt Down to open filter Menu | 11:00 AM Press Enter to sort. Press Alt Down to open filter Menu | 11:30 AM Press Enter to sort. Press Alt Down to open filter Menu | 12:00 PM Press Enter to sort. Press Alt Down to open filter Menu | 12:30 PM Press Enter to sort. Press Alt Down to open filter Menu | 1:00 PM Press Enter to sort. Press Alt Down to open filter Menu | 1:30 PM Press Enter to sort. Press Alt Down to open filter Menu | 2:00 PM Press Enter to sort. Press Alt Down to open filter Menu | 2:30 PM Press Enter to sort. Press Alt Down to open filter Menu | 3:00 PM Press Enter to sort. Press Alt Down to open filter Menu | 3:30 PM Press Enter to sort. Press Alt Down to open filter Menu | 4:00 PM Press Enter to sort. Press Alt Down to open filter Menu | 4:30 PM Press Enter to sort. Press Alt Down to open filter Menu | 5:00 PM Press Enter to sort. Press Alt Down to open filter Menu |
|---|
| 10001 | Nancy Davolio | Analysis Tasks | Team Meeting | Testing | Development | Code Review | Development | Support | Lunch Break | Testing | Development | Conference | Team Meeting | |||||
| 10002 | Steven Buchanan | Analysis Tasks | Support | Testing | Code Review | Development | Documentation | |||||||||||
| 10003 | Andrew Fuller | Documentation | Analysis Tasks | Support | Development | Team Meeting | Development | |||||||||||
| 10004 | Janet Leverling | Testing | Documentation | Support | Testing | Development | Code Review | Documentation | Conference | Team Meeting | ||||||||
| 10005 | Margaret Parker | Task Assign | Documentation | Support | Development | Team Meeting | Testing | |||||||||||
| 10006 | Janet King | Testing | Support | Team Meeting | Development | Code Review | Development | |||||||||||
| 10007 | Michael Suyama | Analysis Tasks | Testing | Development | Testing | Support | Build | Documentation | ||||||||||
| 10008 | Robert King | Task Assign | Development | Testing | Support | Documentation | Team Meeting | Build | ||||||||||
| 10009 | Andrew Callahan | Documentation | Team Meeting | Support | Testing | Development | Team Meeting | Development | ||||||||||
| 10010 | Michael Dodsworth | Task Assign | Analysis Tasks | Testing | Build | Task Assign | Testing | Build | Testing | |||||||||
This sample demonstrates the DataGrid automatic cell merging feature for combining adjacent cells with identical values.
The Blazor DataGrid supports automatic cell merging, allowing adjacent cells with identical values to be combined horizontally, vertically, or in both directions. This creates a cleaner and more readable data layout.
The cell merging behavior is controlled by the AutoSpan property, which is bound to a dropdown selector in this demo. Available merging modes are:
- None - Disables cell merging; displays original grid layout
- Row - Merges identical cells horizontally across columns within the same row
- Column - Merges identical cells vertically down the same column
- HorizontalAndVertical - Applies both horizontal and vertical cell merging simultaneously (default)
Select different modes from the dropdown to see how the cell merging behavior changes. By default, AutoSpanMode.HorizontalAndVertical is applied, providing optimal readability by merging identical cells across both rows and columns.
For more detailed information about row and column spanning, refer to the row and column spanning documentation.