How to: Enable Automatic Height Adjustment
- 2 minutes to read
- Automatic Node Height Adjustment
- Disable Automatic Node Height Adjustment
- Specify Custom Height
- Automatic Node Height and Image Data
- Automatic Node Height and Text Data
- Specify Custom Image Height
Automatic Node Height Adjustment
The Tree list node height is set to match content height.
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.
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.
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.
Automatic Node Height and Text Data
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.
Specify Custom Image Height
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.