TreeView — Image Customization & Configuration
These properties control the expand/collapse icon images, tooltip text, and data-binding configuration of the TreeView component.
Custom Expand / Collapse Images with Tooltips
Use CollapseImageUrl, ExpandImageUrl, and NoExpandImageUrl
to replace the default +/- icons. Tooltips are provided via CollapseImageToolTip and
ExpandImageToolTip.
<TreeView CollapseImageUrl="/img/collapse.png"
CollapseImageToolTip="Click to collapse"
ExpandImageUrl="/img/expand.png"
ExpandImageToolTip="Click to expand"
NoExpandImageUrl="/img/leaf.png">
<Nodes>
<TreeNode Text="Documents" Value="docs" Expanded="true">
<TreeNode Text="Reports" Value="reports">
<TreeNode Text="Q1 Report" Value="q1" />
</TreeNode>
</TreeNode>
</Nodes>
</TreeView>
MaxDataBindDepth
MaxDataBindDepth limits how many levels of a data source are bound to the tree.
The default is -1 (bind all levels). Setting it to 2 restricts binding
to 2 levels deep.
<TreeView MaxDataBindDepth="2">
<!-- Only 2 levels will be bound from a data source -->
</TreeView>
EnableClientScript & AutoGenerateDataBindings
EnableClientScript (default true) is accepted for migration compatibility
with Web Forms. AutoGenerateDataBindings controls whether data bindings are
automatically created when a data source is attached.
<TreeView EnableClientScript="false" AutoGenerateDataBindings="false">
<Nodes>
<TreeNode Text="Manual Bindings" Value="manual" />
</Nodes>
</TreeView>
Properties Reference
| Property | Type | Default | Description |
|---|---|---|---|
CollapseImageUrl | string | null | URL of the image shown on collapsible nodes |
CollapseImageToolTip | string | null | Tooltip for the collapse image |
ExpandImageUrl | string | null | URL of the image shown on expandable nodes |
ExpandImageToolTip | string | null | Tooltip for the expand image |
NoExpandImageUrl | string | null | URL of the image shown on leaf nodes (no children) |
LineImagesFolder | string | null | Folder path containing line images for the tree |
MaxDataBindDepth | int | -1 | Maximum depth for data binding (-1 = all levels) |
AutoGenerateDataBindings | bool | false | Whether to auto-generate data bindings from a data source |
EnableClientScript | bool | true | Migration stub — accepted for compatibility with Web Forms |

