MudBlazor/MudBlazor
View on GitHubDataGrid: Support server side grouping when using ServerData property
Open
#9,295 opened on Jul 2, 2024
enhancementhelp wanted
Repository metrics
- Stars
- (10,394 stars)
- PR merge metrics
- (Avg merge 6d 6h) (108 merged PRs in 30d)
Description
Feature request type
Enhance component
Component name
DataGrid
Is your feature request related to a problem?
No response
Describe the solution you'd like
When using MudDataGrid with the ServerData feature like so:
<MudDataGrid ServerData="LoadGridData">
The GridState<T> object does not provide any GroupDefinitions. Therefore its not possible to apply grouping on the server side.
Currently, the grid naively only groups client side. However, when using server side paged results, this does not make sense as it will only group on data of the current page.
To make this work, the following changes have to be implemented (roughly outlined, not detailed):
GridState<T>needs to have a propertyGroupDefinitionswhich includes the currently grouped columnsGridData<T>needs to have a propertyGroupedItemsof typeIEnumerable<IGrouping<string, T>>? GroupedItemswhich includes the currently grouped items- Grid should render already grouped server side data and should not group on client side at all.
Have you seen this feature anywhere else?
No response
Describe alternatives you've considered
No response
Pull Request
- I would like to do a Pull Request
Code of Conduct
- I agree to follow this project's Code of Conduct