MudBlazor icon indicating copy to clipboard operation
MudBlazor copied to clipboard

MudDataGrid state handling

Open AlbinHedinIT opened this issue 1 year ago • 4 comments
trafficstars

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

AlbinHedinIT avatar Dec 07 '23 15:12 AlbinHedinIT

I've also asked the question on the Discord form without any success of resolving this.

AlbinHedinIT avatar Dec 07 '23 15:12 AlbinHedinIT

This would be a good enhancement, need events for sort order changed, column order and any other cosmetic changes.

AlexW68 avatar Dec 07 '23 15:12 AlexW68

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.

AlbinHedinIT avatar Dec 08 '23 08:12 AlbinHedinIT

+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.

pingu2k4 avatar Jan 31 '24 16:01 pingu2k4

This is a copy of: link More comments regarding a solution can be found there.

AlbinHedinIT avatar May 21 '24 10:05 AlbinHedinIT