System.Web.UI.WebControls.TreeView.CollapseImageUrl Property

Gets or sets the URL to a custom image for the collapsible node indicator.

Syntax

[System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.Web.UI.UrlProperty]
[System.ComponentModel.DefaultValue("")]
public string CollapseImageUrl { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the TreeView.CollapseImageUrl property to specify a custom image for the collapsible node indicator. This image is displayed next to a collapsible node and is usually a minus sign (-).

When the TreeView.ShowExpandCollapse property is set to true, the System.Web.UI.WebControls.TreeView control displays a plus sign (+) or a 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 TreeView.ImageSet property to TreeViewImageSet.Custom, and then setting the TreeView.NoExpandImageUrl, TreeView.ExpandImageUrl, and TreeView.CollapseImageUrl properties to the URLs for the custom images. If no images are specified, the default images are used. To hide the expansion node indicators, set the TreeView.ShowExpandCollapse property to false.

Note:

To ensure that nodes align correctly in the System.Web.UI.WebControls.TreeView control when using custom images, make sure that all the images that are specified by the TreeView.NoExpandImageUrl, TreeView.ExpandImageUrl, and TreeView.CollapseImageUrl properties have the same dimensions.

When using a custom image for the collapsible node indicator, you should also consider setting the TreeView.CollapseImageToolTip property to specify a ToolTip for the image.

The value of this property is stored in view state.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0