System.Web.UI.WebControls Namespace TreeView Class
.NET Framework version 2.0
Sets or retireves a value indicating whether expansion node indicators are displayed in a TreeView control.
Inline |
<asp:treeview showexpandcollapse = true | false ... > |
Script |
TreeView.ShowExpandCollapse [ = true | false ] |
This property accepts or returns only a boolean value: true to show the expansion node indicators; otherwise, false. Default value is true.
Use the ShowExpandCollapse property to specify whether expansion node indicators are displayed in a TreeView control. Expansion node indicators are used to show whether a node is expanded, collapsed, or non-expandable.
When the ShowExpandCollapse property is set to true, the TreeView control displays a plus sign ( + ) or minus sign ( - ) or a placeholder image next to a node to indicate whether the node is expandable, collapsible, or non-expandable, respectively. You can specify custom images by first setting the ImageSet property to Custom, and then setting the ExpandImageUrl, and CollapseImageUrl, and NoExpandImageUrl properties to the URLs of the custom images. If no images are specified, the default images are used.
The following example demonstrates how to use the ShowExpandCollapse property to hide the expansion node icons.
<asp:treeview id = "myTreeView" runat = "server"
expanddepth=1
showexpandcollapse=false>
<levelstyles>
...
</levelstyles>
</asp:treeview>
TreeView Members