Sizing & ordering

The resizing and reordering logic underneath resizableColumns and reorderableColumns.

resolveColumnWidths, fitColumnsToWidth, applyColumnOrder, and moveColumnBefore are the functions DataGridComponent calls internally when resizableColumns or reorderableColumns is enabled. Reach for them directly if you're building a custom grid adapter.

PropTypeDefaultDescription
resolveColumnWidths(columns, options)readonly ResolvedColumn<Row>[]

Resolves each column's rendered width from its definition, sizing state, and grid defaults.

fitColumnsToWidth(columns, width)readonly ResolvedColumn<Row>[]

Redistributes width across columns under resizeMode="fit".

applyColumnOrder(order, event)ColumnOrderState

Applies a column-order event to produce the next order state.

moveColumnBefore(order, columnId, beforeId)ColumnOrderState

Moves one column id to sit before another in the order.

The same logic, in the React grid

resizableColumns + reorderableColumns

Live example
Resize mode
IdServiceEnvironment NameEnvironment RegionStatusCostCost
1checkout-apiproductionus-east-1healthy1240.5$1,240.50
2billing-workerproductioneu-west-1degraded860.2$860.20
3search-indexstagingus-east-1healthy92.75$92.75
4notificationsproductionus-west-2down305.4$305.40
5analytics-pipelinestagingeu-west-1healthy145$145.00