Skip to main content

ColumnView.CalcColumnBestWidth(GridColumn) Method

Returns the minimum width that the specified column needs to display its contents completely.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

public int CalcColumnBestWidth(
    GridColumn column
)

Parameters

Name Type Description
column GridColumn

A GridColumn object which represents the grid column.

Returns

Type Description
Int32

An integer value which specifies the minimum width which is required to display the column’s contents completely. 0 if the specified column is a null reference.

Remarks

If the column’s OptionsColumn.FixedWidth option is set to true, the CalcColumnBestWidth method returns the column’s width which is specified by its GridColumn.Width property.

The CalcColumnBestWidth method is not supported in a CardView.

See Also