TreeView.ShowExpandCollapse Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets a value indicating whether expansion node indicators are displayed.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public:
property bool ShowExpandCollapse {
	bool get ();
	void set (bool value);
}
/** @property */
public boolean get_ShowExpandCollapse ()

/** @property */
public void set_ShowExpandCollapse (boolean value)

public function get ShowExpandCollapse () : boolean

public function set ShowExpandCollapse (value : boolean)

Property Value

true to show the expansion node indicators; otherwise, false. The default is true.

Expansion node indicators are used to show whether a node is expanded, collapsed, or non-expandable. Use the ShowExpandCollapse property to specify whether the expansion node indicators are displayed in the TreeView control.

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.

The value of this property is stored in view state.

The following code example demonstrates how to use the ShowExpandCollapse property to show and hide the expansion node icons.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: