Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data grid] Cannot reorder pinned columns by drag and drop #16523

Open
rhyswatsonto opened this issue Feb 10, 2025 · 2 comments
Open

[data grid] Cannot reorder pinned columns by drag and drop #16523

rhyswatsonto opened this issue Feb 10, 2025 · 2 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Column pinning Related to the data grid Column pinning feature feature: Reordering Related to the data grid Reordering feature new feature New feature or request priority: low To delay as much as possible

Comments

@rhyswatsonto
Copy link

rhyswatsonto commented Feb 10, 2025

Summary

Hi, I noticed that drag and dropping to reorder pinned columns is not possible. Note I am just talking about reordering between multiple pinned columns.

To recreate:
Using Data Grid: pin more than 1 columns, then try to drag and drop to reorder the columns.

The only workaround right now is to unpin the columns, then re-pin them in the desired order.

Examples

https://mui.com/x/react-data-grid/column-pinning/#initializing-the-pinned-columns, using this example if we pin multiple columns and try to drag and drop it will not work.

In the documentation it specifically calls out that pinned columns cannot be reordered: https://github.com/mui/mui-x/blob/master/docs/data/data-grid/column-pinning/column-pinning.md
"Data Grid - Column pinning
Pin columns to keep them visible at all time.

Pinned (or frozen, locked, or sticky) columns are columns that are visible at all time while the user scrolls the Data Grid horizontally. They can be pinned either to the left or right side and cannot be reordered."

Motivation

Our users noticed that it was strange that they could not reorder the pinned columns.

Search keywords: Pinned Data Grid Drag and Drop Reorder

@rhyswatsonto rhyswatsonto added new feature New feature or request status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 10, 2025
@michelengelen
Copy link
Member

This seems like a valid addition to the pinned columns feature. I'll add this to the board for the team to look at it.

In the meantime you could build a workaround by using the controlled model and a custom drag'n'drop implementation. It's a quite a heavy customization though

@michelengelen michelengelen added component: data grid This is the name of the generic UI component, not the React module! feature: Column pinning Related to the data grid Column pinning feature feature: Reordering Related to the data grid Reordering feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 11, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Feb 11, 2025
@michelengelen michelengelen changed the title Data Grid: Cannot reorder pinned columns by drag and drop [data grid] Cannot reorder pinned columns by drag and drop Feb 11, 2025
@cherniavskii cherniavskii added the priority: low To delay as much as possible label Feb 11, 2025
@rhyswatsonto
Copy link
Author

Thank you, this would be a very welcome addition.
I will look into a custom implementation, but like you said it did seem like a bigger overhaul then we are looking to do at this moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Column pinning Related to the data grid Column pinning feature feature: Reordering Related to the data grid Reordering feature new feature New feature or request priority: low To delay as much as possible
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

3 participants