[DataGrid] Implement Column pinning
Benchmark
- https://ant.design/components/table/#components-table-demo-fixed-columns
- https://devexpress.github.io/devextreme-reactive/react/grid/docs/guides/fixed-columns/
- https://ag-grid.com/javascript-grid-pinning/
- https://www.telerik.com/kendo-react-ui/components/grid/columns/locked/
- https://demos.telerik.com/kendo-ui/grid/frozen-columns
- http://schrodinger.github.io/fixed-data-table-2/fixed-right-columns.html
- https://ej2.syncfusion.com/react/demos/#/material/grid/frozen-rows
- http://tabulator.info/docs/4.5/layout#frozen
- https://www.jqwidgets.com/react/react-grid/#https://www.jqwidgets.com/react/react-grid/react-grid-pinnedfrozencolumns.htm
- https://material-table.com/#/docs/features/fixed-columns, the issue: https://github.com/mbrn/material-table/issues/43
We need to find a final name for the feature. There are a bunch of options: Sticky, Frozen, Locked, or Pinned. We are leaning to Pinning.
@oliviertassinari This is cool. Two questions:
- Is the idea that it would be a user-triggered feature (user can pin interesting columns), a developer-configured feature or some combination of both?
- Are you planning to incorporate the ability to pin columns to the right (e.g.- AntD's
fixed="right")?
If there's some other place I could have found this info myself, please let me know. This feature would definitely be useful for us.
@caitecoll 1. Which one do you need? We will start with a developer-configuration as it's simpler. 2. I think that left and right pinning should be supported.
Thanks, that sounds great. Developer configuration and right pinning are the two things we need.
@oliviertassinari Great feature. I've implemented a similar feature in a private grid. The challenge was to ensure keyboard navigation flows naturally when a column is moved out of order to either left or right region. The other challenge is depending on how the underlying html is rendered you may or may not have the ability to support rows with variable heights (height="auto")
Another improvement is to show soft shadow dynamically on either of the pinned columns depending on the horizontal scroll position.
For our use case it's critical that we can pin the checkbox which currently is implemented as a pseudo-column via the checkboxSelection prop. Do you plan to add another prop like pinnedCheckbox?
@ak-mid Do you have a visual illustration of what you mean by "pinning the checkbox"?
@oliviertassinari Sorry, I have no visual illustration at hand right now :( The use case is that the checkbox on the left to select a row is still available (pinned, sticky) if a user scrolls horizontally inside of the grid. It's actually like pinning the first row of the grid which includes a checkbox.
We really need this "Sticky" column functionality for our application. Do we have an idea of when this will be available?
Would really love to see this feature soon. Is there any ETA?
Is this something that will prevent the checkbox from being draggable? In DataGrid it seems to be stuck in position, but in XGrid the checkbox column can be dragged and moved around. You can see it here:
https://codesandbox.io/s/gttt1?file=/demo.tsx
The checkbox column is draggable ^
@y2b1 What's your expected outcome? (It makes me think about #1672).
@oliviertassinari Is this available to work on? It seems like the most common requests are:
- pinning columns to the left and right
- being able to pin the checkbox "column"
- doing this from the developer side only
I would love to contribute if possible.
@tylerlinquata Note that we intend to license the feature as part of the Pro plan. If this is not a showstopper and you are willing to sign a Copyright Assignment Agreement then we could continue the discussion further :).
@oliviertassinari I'm talking to my company about it, I'll update if they'd be willing to sign an agreement.
Is it possible to release it a little faster - the ability to make a pin not programmatically, but only with a fix with an indication in props. example: fixedColumn Unfortunately, due to virtualization, I could not do it with styles.

Has anyone taken this feature up to complete?
any progress ?
This was on the Q3 2021 Jul - Sep roadmap. Any updates on timeline?
We spent most of our Q3 adapting for the v5 version of the core and building strong internals to be future proof. The roadmap for Q4 / Q5 is currently being redacted. The column pinning will be part of Q4. Is needs #2673 (like most of our new features) but once this is ready, it should be an easy feature to build.