Back to Devexpress

TableView.CalcColumnBestFitWidth(BaseColumn) Method

wpf-devexpress-dot-xpf-dot-grid-dot-tableview-dot-calccolumnbestfitwidth-x28-devexpress-dot-xpf-dot-grid-dot-basecolumn-x29.md

latest2.1 KB
Original Source

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public double CalcColumnBestFitWidth(
    BaseColumn column
)
vb
Public Function CalcColumnBestFitWidth(
    column As BaseColumn
) As Double

Parameters

NameTypeDescription
columnBaseColumn

A GridColumn object that represents the grid column.

|

Returns

TypeDescription
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

BestFitWidth

TableView Class

TableView Members

DevExpress.Xpf.Grid Namespace