Export (0) Print
Expand All
6 out of 10 rated this helpful - Rate this topic

TREEVIEW Element | TreeView Class

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

Syntax

ASP <tagPrefix:TREEVIEW ... >

Possible Values

tagPrefix Required. 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
Attribute Property Description
AUTOPOSTBACK AutoPostBack 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.
AUTOSELECT AutoSelect Sets or retrieves a value that indicates whether or not keyboard hovering selects a node.
CHILDTYPE ChildType Sets or retrieves the type of TreeNodeType to use for all descendents.
DEFAULTSTYLE DefaultStyle Sets or retrieves a value that indicates the default style for the element.
EXPANDEDIMAGEURL ExpandedImageUrl Sets or retrieves the URL of an image to use for expanded nodes.
EXPANDLEVEL ExpandLevel 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.
HOVERSTYLE HoverStyle Sets or retrieves a value that indicates the style of the element when the user hovers the keyboard focus or mouse pointer over it.
IMAGEURL ImageUrl Sets or retrieves a value that indicates the URL of the image to be displayed on a node or toolbar item.
INDENT Indent Sets or retrieves the number of pixels to indent children in relation to the parent node.
SELECTEDIMAGEURL SelectedImageUrl Sets or retrieves the URL of an image to use for a selected node or TAB.
SELECTEDNODEINDEX SelectedNodeIndex Sets or retrieves the index of the selected node.
SELECTEDSTYLE SelectedStyle Sets or retrieves a value that indicates the style for the selected element.
SELECTEXPANDS SelectExpands Sets or retrieves a value that indicates whether or not a parent node expands or collapses when selected.
SHOWLINES ShowLines Sets or retrieves a value that indicates whether or not to display connecting lines between nodes.
SHOWPLUS ShowPlus Sets or retrieves a value that indicates whether or not a plus or minus sign renders on parent nodes.
SHOWTOOLTIP ShowToolTip Sets or retrieves a System.Boolean that indicates whether to show a default ToolTip for each child node.
SYSTEMIMAGESPATH SystemImagesPath Sets or retrieves the path to the directory that contains supporting tree images (lines, plus and minus signs, and so on).
TARGET Target Sets or retrieves a value that indicates the window or frame at which to target the contents.
TREENODESRC TreeNodeSrc 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.
TREENODETYPESRC TreeNodeTypeSrc Sets or retrieves the URL to an XML file containing TreeNodeType elements.
TREENODEXSLTSRC TreeNodeXsltSrc Sets or retrieves the URL to an Extensible Stylesheet Language Transformations (XSLT) file to transform TreeNode elements.
Elements/Objects
Element Object Description
TREENODE TreeNode Adds a TreeNode to a ASP.NET Web Form.
TREENODETYPE TreeNodeType Adds a TreeNodeType element to a ASP.NET Web Form.
Events
Event Description
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
Method Description
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

Show:
© 2014 Microsoft. All rights reserved.