AutoFitColumns
methodsApplies the minimum possible width for all columns, so that all text fits without wrapping.
The method ignores and does not resize hidden columns.
Auto-fitting all columns at once is a resource-intensive operation and is not recommended. A better option is to auto-fit only a few columns (autoFitColumn) that have the most variable content in terms of length. Alternatively, disable scrolling and allow the browser to adjust all column widths automatically, according to their content.
Use
autoFitColumnsonly after the Grid has been databound. Executing the method immediately after Grid initialization makes no sense and can lead to undesired behavior.