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
Marcus Pope
Poruheca
@kokiwjoj
purioh@fec.cl
61
Elnora Bridges
Fuftonet
@bute
cacacoj@do.ru
68
Rosa Riley
Nikaliw
@bo
bokwetpo@vi.su
33
Luella Buchanan
Heluwuj
@on
ijaudu@gefworsu.be
38
Beulah Walters
Wavvujzo
@kedvaj
beatijun@va.li
30
Cornelia Harper
Elheco
@uce
anka@gonagon.kr
64
Lelia Roberson
Bovojep
@ahifwum
oselel@amih.tf
26
George Sparks
Ohtaknal
@melutokuj
duk@lacerdim.dj
74
Marguerite Mendez
Onuomihu
@bitvo
kivfenij@ho.km
50
Ann Bush
Hinnead
@ma
agur@tu.cc
37
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
Willie Willis
Emadifwej
@tigosga
gomafnu@azkomri.pa
Nell Chavez
Peizealo
@carfuwmem
mizsi@eni.rw
Delia Poole
Nisanlav
@onuwzip
zuz@nafpes.kp
Sue Chambers
Nalpabe
@ebasiuna
la@imhev.vg
Jessie Vaughn
Natnifzod
@tukorhut
jej@lalmaput.pk
Allen Hamilton
Gazsawa
@ju
oc@cizsaut.su
Jeremy Morales
Vowocil
@fowevuc
duvoleco@difocudu.nz
Elizabeth Hill
Fijrezeh
@if
lo@dad.ga
Carl Moss
Nufatu
@ker
sod@raz.pw
Elva Coleman
Hanucezu
@lo
ev@sorioso.sk
Celia Patrick
Etizokhiw
@demgevzow
caha@zote.com
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-3304
Wheat
Lula Sims
82,056
66.79 %
no
Open
D-2237
Coffee C
Ray Farmer
28,121
31.29 %
no
Filled
D-2264
Soybeans
Theresa Nunez
46,580
7.001 %
no
Rejected
D-8865
Soybeans
Robert Bishop
27,963
25.859 %
no
Partially Filled
D-4277
Sugar No.11
Rosetta Hughes
56,814
22.179 %
no
Partially Filled
D-5096
Sugar No.14
Ollie Porter
87,456
31.62 %
no
Open
D-9479
Sugar No.11
Nettie Hopkins
32,558
56.65 %
no
Partially Filled
D-5100
Sugar No.14
Marvin Harper
70,947
51.171 %
no
Partially Filled
D-1182
Milk
Bernard Gordon
54,146
41.05 %
no
Filled
D-7792
Wheat
Lawrence Massey
43,296
17.161 %
no
Partially Filled
D-4723
Adzuki bean
Harvey Clarke
75,547
2.42 %
no
Filled

Rows per page:

1–25 of 97

API