TreeView::NoExpandImageUrl Property
Gets or sets the URL to a custom image for the non-expandable node indicator.
Assembly: System.Web (in System.Web.dll)
<asp:TreeView NoExpandImageUrl="String" />
Property Value
Type: System::StringThe URL to a custom image to display for non-expandable nodes. The default is an empty string (""), which displays the default blank image.
Use the NoExpandImageUrl property to specify a custom image for the non-expandable node indicator. The non-expandable node indicator image (or spacer) is displayed next to leaf nodes (in place of the expandable and collapsible node indicators) to align the leaf nodes with parent or root nodes.
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 TreeViewImageSet.Custom, and then setting the NoExpandImageUrl, ExpandImageUrl, and CollapseImageUrl properties to the URLs of 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. |
The value of this property is stored in view state.
The following code example demonstrates how to use the NoExpandImageUrl property to specify a custom image for the non-expandable 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.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note