Ordering

The reordering logic underneath reorderableColumns.

Last updated August 3, 2026

applyColumnOrder and moveColumnBefore are the functions DataGridComponent calls internally when reorderableColumns is enabled — the first puts a column list in the order an order state gives, the second moves one column id to sit before another. Reach for them directly if you're building a custom grid adapter.

Functions

FunctionTypeDescription
applyColumnOrder(columns, order)readonly ColumnDefinition<Row>[]Puts columns in the order order gives. Ids it omits keep their position among the definitions and follow those listed.
moveColumnBefore(orderedIds, movedId, beforeId)ColumnOrderStateMoves one column id to sit before another, or to the end when beforeId is null. Returns the same reference for a move that changes nothing.
movesColumn(orderedIds, movedId, beforeId)booleanWhether moving movedId in front of beforeId would rearrange anything, for a drop indicator that promises only real moves.
resolveDropBefore(orderedIds, targetId, side)string | null"After C" and "before D" name the same gap — this collapses either side of a drop to the one id it lands in front of.

The same logic, in the React grid

reorderableColumns

Live example
IdServiceEnvironment NameEnvironment RegionStatusCost
1checkout-apiproductionus-east-1healthy1240.5
2billing-workerproductioneu-west-1degraded860.2
3search-indexstagingus-east-1healthy92.75
4notificationsproductionus-west-2down305.4
5analytics-pipelinestagingeu-west-1healthy145
  1. Interact with the grid above to see its callbacks fire.
<DataGridComponent
  columns={columns}
  dataSource={rows}
  reorderableColumns
/>;
Edit this page on GitHub