TREEVIEW Element | TreeView Class

Adds a TreeView element to a ASP.NET Web Form.

Syntax

ASP <tagPrefix:TREEVIEW ... >

Possible Values

tagPrefixRequired. The element prefix associated with the WebControls namespace (Microsoft.Web.UI.WebControls). A TagPrefix is defined using the directive.

Members Table

The following table lists the members exposed by the TreeView object.

Attributes/Properties
AttributePropertyDescription
AUTOPOSTBACKAutoPostBack Sets or retrieves a value that indicates whether or not the control posts back to the server each time a user interacts with the control.
AUTOSELECTAutoSelect Sets or retrieves a value that indicates whether or not keyboard hovering selects a node.
CHILDTYPEChildType Sets or retrieves the type of TreeNodeType to use for all descendents.
DEFAULTSTYLEDefaultStyle Sets or retrieves a value that indicates the default style for the element.
EXPANDEDIMAGEURLExpandedImageUrl Sets or retrieves the URL of an image to use for expanded nodes.
EXPANDLEVELExpandLevel Sets or retrieves the number of levels to expand within the TreeView.
Font Retrieves the font of the text.
ForeColor Sets or retrieves the color of the text.
HOVERSTYLEHoverStyle Sets or retrieves a value that indicates the style of the element when the user hovers the keyboard focus or mouse pointer over it.
IMAGEURLImageUrl Sets or retrieves a value that indicates the URL of the image to be displayed on a node or toolbar item.
INDENTIndent Sets or retrieves the number of pixels to indent children in relation to the parent node.
SELECTEDIMAGEURLSelectedImageUrl Sets or retrieves the URL of an image to use for a selected node or TAB.
SELECTEDNODEINDEXSelectedNodeIndex Sets or retrieves the index of the selected node.
SELECTEDSTYLESelectedStyle Sets or retrieves a value that indicates the style for the selected element.
SELECTEXPANDSSelectExpands Sets or retrieves a value that indicates whether or not a parent node expands or collapses when selected.
SHOWLINESShowLines Sets or retrieves a value that indicates whether or not to display connecting lines between nodes.
SHOWPLUSShowPlus Sets or retrieves a value that indicates whether or not a plus or minus sign renders on parent nodes.
SHOWTOOLTIPShowToolTip Sets or retrieves a System.Boolean that indicates whether to show a default ToolTip for each child node.
SYSTEMIMAGESPATHSystemImagesPath Sets or retrieves the path to the directory that contains supporting tree images (lines, plus and minus signs, and so on).
TARGETTarget Sets or retrieves a value that indicates the window or frame at which to target the contents.
TREENODESRCTreeNodeSrc Sets or retrieves a value that indicates the URL of an XML file, System.String, or XML data island containing TreeNode elements.
TreeNodeTypes Retrieves a collection of TreeNodeType objects that are in the TreeView.
TREENODETYPESRCTreeNodeTypeSrc Sets or retrieves the URL to an XML file containing TreeNodeType elements.
TREENODEXSLTSRCTreeNodeXsltSrc Sets or retrieves the URL to an Extensible Stylesheet Language Transformations (XSLT) file to transform TreeNode elements.
Elements/Objects
ElementObjectDescription
TREENODETreeNode Adds a TreeNode to a ASP.NET Web Form.
TREENODETYPETreeNodeType Adds a TreeNodeType element to a ASP.NET Web Form.
Events
EventDescription
oncheck Fires on the tree when a node's check box is clicked.
oncollapse Fires on the tree when an expanded tree node is collapsed.
onexpand Fires on the tree when a collapsed tree node is expanded.
onselectedindexchange Fires when the user changes the selected TreeNode on the TreeView.
Methods
MethodDescription
DataBind Binds the data to the TreeNode or the TreeView whether the TreeNode has been expanded or not.
GetNodeFromIndex Returns the TreeNode object at the specified index.

Class Information

Namespace Microsoft.Web.UI.WebControls

See Also

Page view tracker