Back to Devexpress

ColumnView.CalcColumnBestWidth(GridColumn) Method

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnview-dot-calccolumnbestwidth-x28-devexpress-dot-xtragrid-dot-columns-dot-gridcolumn-x29.md

latest2.5 KB
Original Source

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

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

Declaration

csharp
public int CalcColumnBestWidth(
    GridColumn column
)
vb
Public Function CalcColumnBestWidth(
    column As GridColumn
) As Integer

Parameters

NameTypeDescription
columnGridColumn

A GridColumn object which represents the grid column.

|

Returns

TypeDescription
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

BestFit()

GetBestWidth()

BestFitColumns

BestFitMaxRowCount

ColumnView Class

ColumnView Members

DevExpress.XtraGrid.Views.Base Namespace