LyteNyte Grid logo for light mode. Links back to the documentation home page.
Rows

Row Pinning

LyteNyte Grid can freeze rows at the top or bottom of the grid viewport. Pinned rows remain visible as the user scrolls.

Pinned Row Specifications

The grid’s data source defines which rows are pinned. How you specify pinned rows depends on the type of row data source in use.

The demo below uses the client row data source to demonstrate row pinning. For other data sources, see their respective guides:

Pinned Rows

Fork code on stack blitzFork code on code sandbox

Pinned Row Indices

LyteNyte Grid assigns row indices sequentially from top to bottom. When the grid includes pinned rows, the first row index belongs to the first top-pinned row, and the final index belongs to the last bottom-pinned row.

This indexing model has an important implication. When rows are pinned to the top, the row indices of scrollable rows are offset by the number of top-pinned rows. This matters when you work with rows by index, such as when retrieving a row programmatically. To access the first scrollable row by index, you must account for the number of rows pinned at the top.

The marker column demo below makes this behavior explicit:

Offset Pinned Rows

Fork code on stack blitzFork code on code sandbox

In this example, the first scrollable row displays an index of 3 because two rows are pinned to the top. The bottom-pinned rows display indices 17 and 18, reflecting their position after both the top-pinned and scrollable rows.

Next Steps

  • Row Full Width: Create rows that span the full width of the viewport.
  • Row Dragging: Drag and drop rows within or between LyteNyte grids, or into external drop zones and apps.
  • Row Spanning: Span cells across multiple rows.