TreeListOptionsView.BestFitMaxNodeCount Property

Gets or sets the number of data nodes whose content is processed to apply best fit to columns.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v20.1.dll


public virtual int BestFitMaxNodeCount { get; set; }
Public Overridable Property BestFitMaxNodeCount As Integer

Property Value

Type Default Description


An integer value specifying the number of data nodes that are processed to apply best fit to columns.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to BestFitMaxNodeCount
WinForms Controls GanttControl
Reporting XRDesignFieldList


When applying the best fit feature to a column, the column is resized so that it displays the complete contents of its header, footer cell and data cells. The number of data nodes taken into account for this calculation is specified by the BestFitMaxNodeCount property:

  • If set to -1, all nodes are processed.
  • If set to a positive integer, the TreeList processes the specified number of nodes starting from the top visible node.
  • If set to 0 forces the TreeList to ignore data cell content when applying the best fit feature. In this case, columns are resized to fit the contents of their header and footer cells only.

Setting the BestFitMaxNodeCount property to a non-default value automatically sets the TreeListOptionsView.BestFitNodes property to Custom. To use the All, Visible or Display mode, reset the BestFitMaxNodeCount property to its default value.

You can apply the best fit feature to columns using the TreeList.BestFitColumns or TreeListColumn.BestFit methods. End-users can also use the best fit feature via the column header context menu.

See Also