Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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