MudBlazor
MudBlazor copied to clipboard
MudDataGrid state handling
Feature request type
Enhance component
Component name
MudDataGrid
Is your feature request related to a problem?
We need to store the state of the current dialog. Mainly the column reordering and what colums that are hidden/visible. Next time user visit the page, then the datagrid looks same as where user left it. That is that users may show/hide columns and use drag n drop to re-order the columns.
Describe the solution you'd like
We need to be able to handle ColumnOrderChanged => so that we can e.g. store state in localstorage. As well as passing input ColumnOrder to the datagrid so that the columns are correctly ordered. Same idea goes for Hidden/Visible.
Have you seen this feature anywhere else?
This feature is available many places on the webb. E.g. the Azure DevOps board. Simply, the state can be stored.
Describe alternatives you've considered
I've tried a lot and looked into the MudBlazor source code but really can not find any hacky way around this at all.
Pull Request
- [ ] I would like to do a Pull Request
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
I've also asked the question on the Discord form without any success of resolving this.
This would be a good enhancement, need events for sort order changed, column order and any other cosmetic changes.
Correct! There may defineltely be more states to be stored. In my case however, im firstly looking for the column ordering and visibility. But the very next step would be to store the sort definitions.
+1, Would love to use this for remembering visibility personally.
As a workaround, I will be creating my own context menu rather than the menu from ShowMenuIcon, and displaying / handling all state changes etc there.
This is a copy of: link More comments regarding a solution can be found there.