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

TableView.CalcColumnBestFitWidth(BaseColumn) Method

Returns the column’s optimal (minimum) width required to display its contents completely.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public double CalcColumnBestFitWidth(
    BaseColumn column
)

#Parameters

Name Type Description
column BaseColumn

A GridColumn object that represents the grid column.

#Returns

Type Description
Double

A Double value that specifies the column’s optimal (minimum) width required to display its contents completely.

#Remarks

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

Note

The CalcColumnBestFitWidth method should only be called when the grid is loaded.

To learn more, see Best Fit in Columns Layout and Width.

See Also