View as Markdown

Frozen Rows and Columns

Pinned columns and sticky rows

Pin columns to the start or end, fix them in place between the scrolling columns, and keep the first or last rows in view while the body scrolls.

Pinned columns (also called frozen columns) stay in view while the other columns scroll horizontally. The grid splits its columns into three zones: a start zone, the scrolling center and an end zone. Only the center zone is column-virtualized; pinned columns always render.

Pinning columns

A column definition pins itself with pinned: 'start' or pinned: 'end'. The sides are logical: start is the left edge in a left-to-right grid and the right edge in RTL.

The grid pinnedColumns prop is a count shorthand: pinnedColumns={{ start: 2 }} pins the first two visible columns and end the last ones. It is reactive, and an explicit column pinned always wins over the count.

<DataGrid
  columns={[
    { field: 'id', header: 'Order', pinned: 'start' },
    // ...
    { field: 'amount', header: 'Amount', pinned: 'end' },
  ]}
  pinnedColumns={{ start: 2 }}
  stickyRows={2}
  stickyBottomRows={1}
/>

Fixed columns

pinned: 'center' fixes a column in place: the column stays where it is declared among the scrolling columns, with scrolling columns on both sides of it. When you scroll, it moves with its slot until it reaches the start edge (after the start-pinned columns and any earlier fixed column), then stays there while the other columns pass beneath it. A fixed column declared beyond the first screen waits at the end edge (before the end-pinned columns) until its slot scrolls into view. So a fixed column is always visible, and the slot it leaves is always covered.

const columns = [
  { field: 'id', header: 'Order', pinned: 'start' },
  { field: 'customer', header: 'Customer' },
  { field: 'product', header: 'Product', pinned: 'center' },
  // ...
];

A fixed column keeps its place in the column order: keyboard navigation, aria-colindex and reordering treat it as a scrolling column (drag it to move its slot), and it stays rendered under column virtualization. When focus scrolls another column into view, the grid keeps that column clear of the fixed ones. api.pinColumn(field, 'center') fixes a column at runtime; null releases it in place. With stacked headers, only the fixed leaf header is sticky; its group header scrolls with the center.

Pinning at runtime

The column menu and the header context menu carry pinStart, pinEnd and unpin items; unpin also releases a fixed column. With the keyboard, Alt+Shift+ArrowLeft and Alt+Shift+ArrowRight pin the focused header to the start or end and Alt+Shift+ArrowUp unpins it. api.pinColumn(field, 'start' | 'end' | 'center' | null) does the same from code. Every path raises the cancelable onBeforeColumnPinChange (call preventDefault() to keep the column where it is) and then onColumnPinChange with pinned and previousPinned.

A pinned column moves to the inner edge of its new zone; the column set is not recompiled. Reordering, by drag or Mod+ArrowLeft / Mod+ArrowRight (Alt+ArrowLeft / Alt+ArrowRight also work; Mod is Ctrl, or ⌘ on macOS), never moves a column across a zone edge.

A shadow marks the edge of each pinned zone while content scrolls beneath it, mirrored in RTL and replaced by a border in forced-colors mode.

Editing pinned columns

Pinning only changes where a column is drawn. Cells of pinned columns edit like scrolling cells: double-click, F2 and Enter start editing, and a column pinned at runtime keeps its editor and validation. The demo below uses editing={{ mode: 'cell' }}; edit the pinned Amount column, or pin Customer and edit it there.

The fill handle, detail rows and child grids work with pinned columns too:

  • Fill handle. With editing.fillHandle, a range drags across a pin edge like any column edge: from a start-pinned column into the scrolling columns, or from the scrolling columns into an end-pinned one, and down past the rendered rows with auto-scroll. The Range fill demo pins Customer to the start and Note to the end.
  • Detail rows. A detail row spans the full grid width under start and end pinned columns, and its content stays in view while the columns scroll (see Detail rows).
  • Child grids. A child grid mounts in a full-width detail row of a parent with pinned columns and stays in view while the parent columns scroll (see Child grids).

Sticky rows

stickyRows keeps the first N rows of the visible row model below the header, and stickyBottomRows keeps the last N above the footer. The rows are positions in the sorted, filtered row model, so they follow sorting and filtering, and the virtual row window skips them.

Pinned columns and sticky rows

Open demo

Columns pinned to the start or end, or fixed in place (pinned: 'center'), by definition, by the reactive pinnedColumns count or at runtime from the column menu, Alt+Shift+Arrow keys and api.pinColumn, plus stickyRows and stickyBottomRows over 2,000 virtualized rows.

Order
Customer
Country
City
Product
Category
Qty
Unit price
Discount
Placed
Priority
Note
Amount
ORD-10000
Jun Park
Japan
Osaka
Kettle
Equipment
4
$64.90
0%
Jun 21, 2026
Low
Leave the parcel with the building reception if nobody answers the door.
$259.60
ORD-10001
Aiko Tan
Germany
Munich
Filter beans
Coffee
5
$14.00
15%
Jun 26, 2026
High
$59.50
ORD-10002
Bao Nguyen
France
Reims
Grinder
Equipment
7
$129.00
5%
Jul 16, 2026
High
Call before delivery
$857.85
ORD-10003
Aiko Tan
Malaysia
Kuala Lumpur
Oolong tea
Tea
9
$12.75
10%
May 8, 2026
Normal
$103.28
ORD-10004
Farah Aziz
Portugal
Porto
Pour-over kit
Equipment
5
$42.00
5%
Oct 3, 2026
High
$199.50
ORD-10005
Bao Nguyen
Malaysia
Penang
Espresso beans
Coffee
6
$18.50
10%
Aug 11, 2026
Low
Gift wrap
$99.90
ORD-10006
Bao Nguyen
France
Lyon
Grinder
Equipment
8
$129.00
15%
Jan 13, 2026
Low
$877.20
ORD-10007
Jun Park
Malaysia
Kuala Lumpur
Grinder
Equipment
5
$129.00
0%
Dec 28, 2026
Normal
$645.00
ORD-10008
Farah Aziz
Malaysia
Penang
Filter beans
Coffee
9
$14.00
5%
Aug 21, 2026
High
Leave the parcel with the building reception if nobody answers the door.
$119.70
ORD-10009
Aiko Tan
Malaysia
Penang
Grinder
Equipment
11
$129.00
15%
Jun 23, 2026
Low
$1,206.15
ORD-10010
Ines Duarte
Malaysia
Penang
Pour-over kit
Equipment
10
$42.00
5%
Apr 1, 2026
Normal
$399.00
ORD-10011
Dewi Lestari
Germany
Berlin
Grinder
Equipment
1
$129.00
15%
Sep 7, 2026
High
$109.65
ORD-10012
Hana Sato
Malaysia
Kuala Lumpur
Kettle
Equipment
8
$64.90
15%
Apr 4, 2026
High
Gift wrap
$441.32
ORD-10013
Bao Nguyen
Japan
Osaka
Kettle
Equipment
2
$64.90
10%
Oct 11, 2026
Low
Leave the parcel with the building reception if nobody answers the door.
$116.82
ORD-10014
Aiko Tan
France
Lyon
Espresso beans
Coffee
6
$18.50
0%
May 4, 2026
High
Call before delivery
$111.00
ORD-10015
Jun Park
Malaysia
Kuala Lumpur
Pour-over kit
Equipment
9
$42.00
5%
Jan 11, 2026
Normal
$359.10
ORD-10016
Jun Park
Malaysia
Kuala Lumpur
Espresso beans
Coffee
5
$18.50
15%
Sep 4, 2026
Normal
$78.63
ORD-10017
Goran Petrov
Malaysia
Penang
Grinder
Equipment
11
$129.00
10%
Jun 9, 2026
Normal
$1,277.10
ORD-10018
Farah Aziz
Japan
Osaka
Green tea
Tea
7
$9.25
10%
Aug 16, 2026
Low
$58.28
ORD-10019
Dewi Lestari
Malaysia
Kuala Lumpur
Filter beans
Coffee
10
$14.00
5%
Aug 3, 2026
Normal
$133.00
ORD-11999
Bao Nguyen
Portugal
Porto
Pour-over kit
Equipment
12
$42.00
5%
Dec 18, 2026
High
$478.80
No events yet.

API reference

DataGridColumn has the pinned field, DataGridPinnedColumns the pinnedColumns shape, DataGridColumnPinChangeEvent the pin events and DataGridApi pinColumn.