If the columns are resizable
either at the grid level or at the column level (via the columns.resibale
prop), then the column sizing can be done using one of two ways. One way to resize columns is from context menu of the column, choosing the desired option for auto sizing, and the other way is to call several methods from grid reference of the computed props (see handle
There are several methods which can be used for auto sizing columns. One of them is setColumnSizesToFit
method, which sizes columns to fit the available width of the grid.
In order for columns to auto-size, so that the entire content of the column is displayed, you can use setColumnsSizesAuto
method. This method has two optional parameters:
which is an array of the columns ids and a boolean
. If the
, the header width is included in computation of the column size, but if you want to skip the header widh, you can pass
If you want to auto-size a specific column, you can do it calling setColumnSizeAuto
method passing a required argument which is the id of the column to be resized and an optional argument,
, which does the same thing as the method presented above.