[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Member Tables
  [Collapse]Tree List
   [Expand]Product Information
   [Expand]Feature Center
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Collapse]Examples
    [Expand]Data Binding
    [Collapse]Nodes
      How to: Create custom nodes and specify height for individual nodes
      How to: Enable Automatic Height Adjustment
      How to: Iterate through nodes and calculate the number of nodes at a specific level
      How to: Iterate through nodes and collapse specific nodes
    [Expand]Data Editing
    [Expand]Data Representation
    [Expand]Sorting
    [Expand]Summaries
    [Expand]Appearance
    [Expand]Focus and Selection
    [Expand]Miscellaneous
     How to: Drag XtraGrid rows to the XtraTreeList
     How to: Dynamically Show and Hide Specific Nodes
     How to: Format a Column's Numeric Values as Currency
   [Expand]End User Capabilities
   [Expand]Member Tables
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Enable Automatic Height Adjustment

Expanded Automatic Node Height Adjustment

The Tree list node height is set to match content height.

Expanded Disable Automatic Adjustment

To disable automatic height adjustment, set the TreeList.OptionsBehavior.AutoNodeHeight (see TreeListOptionsBehavior.AutoNodeHeight) property to False.

In this mode, node height corresponds to the height of a single text line. Images are scaled to fit automatically calculated height.

Expanded Specify Custom Node Height

To specify custom node height, disable automatic height adjustment, and specify the height using the TreeList.RowHeight property.

Once the custom node height has been set, text fields are properly centered, and images are scaled.

To customize node height, you can also handle the TreeList.CalcNodeHeight event, and specify the CalcNodeHeightEventArgs.NodeHeight event argument.

Expanded Automatic Node Height and Image Data

When automatic height adjustment is turned on, images are displayed using their original dimensions as specified in the database. If you delete an image, node height will be automatically adjusted.

Expanded Automatic Node Height and Text Data

To enable automatic height adjustment for cells with text data, select the column and use the TreeListColumn.ColumnEdit property to assign a new MemoEdit editor.

Ensure that the RepositoryItemMemoEdit.WordWrap property is set to true and then run the application. The Tree List adjusts the node height, so that the text is completely visible. If you add or remove the text, the height will be updated.

Expanded Specify Custom Image Height

To specify custom height for images, assign a PictureEdit to the column. Use the editor's RepositoryItemPictureEdit.CustomHeight property to specify the required value.

If you run the application, you will see that images are now truncated. The editor allows you to see the entire image by dragging it.

To shrink the images so that they fit the specified cell height, set RepositoryItemPictureEdit.SizeMode to PictureSizeMode.Zoom. Note that in this mode, the node keeps its height if you remove the image.

Expanded See Also

Is this topic helpful?​​​​​​​