TreeView.CollapseImageUrl Property
Assembly: System.Web (in system.web.dll)
/** @property */ public String get_CollapseImageUrl () /** @property */ public void set_CollapseImageUrl (String value)
public function get CollapseImageUrl () : String public function set CollapseImageUrl (value : String)
Not applicable.
Property Value
The URL to a custom image to display for collapsible nodes. The default is an empty string (""), which displays the default minus sign (-) image.Use the 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 ShowExpandCollapse property is set to true, the 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 ImageSet property to TreeViewImageSet.Custom, and then setting the NoExpandImageUrl, ExpandImageUrl, and 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 ShowExpandCollapse property to false.
Note: |
|---|
| To ensure that nodes align correctly in the TreeView control when using custom images, make sure that all the images that are specified by the NoExpandImageUrl, ExpandImageUrl, and CollapseImageUrl properties have the same dimensions. |
When using a custom image for the collapsible node indicator, you should also consider setting the CollapseImageToolTip property to specify a ToolTip for the image.
The value of this property is stored in view state.
The following code example demonstrates how to use the CollapseImageUrl property to specify a custom image for the collapsible node indicator. For the code example to display and the image to appear in the control, you must provide your own image and the ImageSet property must be set to TreeNodeImageSet.Custom.
Note: