Skip to content
+

Data Grid - Row pinning

Pin rows to keep them visible at all times.

Pinned (or frozen, locked, or floating) rows are those visible at all times while the user scrolls the data grid vertically.

You can pin rows at the top or bottom of the Data Grid by passing pinned rows data through the pinnedRows prop:

const pinnedRows: GridPinnedRowsProp = {
  top: [{ id: 0, brand: 'Nike' }],
  bottom: [
    { id: 1, brand: 'Adidas' },
    { id: 2, brand: 'Puma' },
  ],
};

<DataGridPro pinnedRows={pinnedRows} />;

The data format for pinned rows is the same as for the rows prop (see Feeding data).

Pinned rows data should also meet Row identifier requirements.

Name
City
Username
Email
Age
Harry Stanley
Worezmuv
@pezubzu
wig@coc.eg
19
Jon Hernandez
Batuklod
@wiob
isiri@anavema.za
20
Allie Mullins
Motiksu
@bolectoh
decorleh@mo.uz
52
Derek Rodriguez
Fancuboju
@ki
ji@suwoh.mp
46
Joe Lee
Cogcuwdum
@lofpo
cirup@coutcol.tk
74
Jeff Harper
Bukope
@diba
oji@cebohaco.mu
80
Harriet Watkins
Muwehacu
@jeelihas
se@ci.ec
30
Todd Lindsey
Rozgigdi
@ni
juhe@uca.pw
78
Amanda Martinez
Fabubwo
@kelle
gu@si.hu
38
Samuel Wilkerson
Rorulro
@rat
pusil@tapi.mk
36
Total Rows: 10
Press Enter to start editing

Controlling pinned rows

You can control which rows are pinned by changing pinnedRows.

In the demo below we use actions column type to add buttons to pin a row either at the top or bottom and change pinnedRows prop dynamically.

Name
City
Username
Email
Lloyd Thornton
Gawpafu
@guli
josmoc@zunuvpi.gh
Celia Goodwin
Hubocovo
@mabcaf
inraade@uloih.pg
Gussie Vega
Lembiif
@vuiwucap
pe@ab.vg
Marcus Bell
Noowesaz
@jap
duwi@ku.vc
Catherine Ward
Jirojze
@mijkak
bu@jana.vn
Gordon Richards
Nupeku
@secgi
lielebe@vutfan.ae
Harvey Hoffman
Tojipim
@lado
fi@ed.tr
Marion Bell
Vobjako
@heksalu
ozzu@libgezeh.ac
Isaac Carr
Darcuko
@donka
gulowet@gafaga.mr
Donald Simpson
Zocluib
@jigsa
zuefu@waggarce.il
Cordelia Diaz
Duehzo
@dosis
do@wohes.nr
Total Rows: 20

Usage with other features

Pinned rows are not affected by sorting and filtering.

Pagination does not impact pinned rows as well - they stay pinned regardless the page number or page size.

Desk
Commodity
Trader Name
Trader Email
Quantity
Filled Quantity
Is Filled
Status
D-3794
Sugar No.11
Bradley Mason
99,089
22.08 %
no
Filled
D-6332
Robusta coffee
Hester Alvarez
49,197
72.261 %
no
Rejected
D-7918
Cocoa
Brian Cole
93,443
12.06 %
no
Rejected
D-1443
Robusta coffee
Pauline Richardson
83,666
77.15 %
no
Partially Filled
D-4323
Coffee C
Blanche Tran
18,489
57.342 %
no
Open
D-3881
Wheat
Cordelia Johnson
54,306
34.88 %
no
Filled
D-5799
Sugar No.14
Ada Reyes
92,919
9.79 %
no
Partially Filled
D-7401
Milk
Martha Adams
82,012
97.089 %
no
Rejected
D-266
Cocoa
Shawn Hampton
99,034
23.56 %
no
Rejected
D-8862
Cocoa
Carrie Fields
99,486
93.93 %
no
Open
D-8778
Sugar No.14
Edward May
18,259
50.769 %
no
Open

Rows per page:

1–25 of 97

API