TREEVIEW Element | TreeView Class
This class represents a TreeView control.
Syntax
Visual Basic Public Class TreeView Inherits BasePostBackControl C# public class TreeView : BasePostBackControl Managed C++ public: __gc class TreeView : public BasePostBackControl JScript public class TreeView extends BasePostBackControl
Inheritance Hierarchy
Object::Control::WebControl::BaseRichControl::BasePostBackControl
Members Table
The following table lists the members exposed by the TreeView object.
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. Nodes Retrieves a collection of TreeNode objects that are in the TreeView. 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 bool 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. ToolTip Sets or retrieves the text that displays when the mouse pointer is over the object. TREENODESRC TreeNodeSrc Sets or retrieves a value that indicates the URL of an XML file, 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.
Element Object Description TREENODE TreeNode This class represents a TreeNode within a TreeView. TREENODETYPE TreeNodeType This class represents a node type and sets attributes to apply to a node or a group of nodes within a TreeView. TreeViewClickEventArgs This class contains the event arguments for the click event. TreeViewSelectEventArgs This class handles event arguments for the SelectedIndexChange event.
Event Description Check Fires on the tree when a node's check box is clicked. Collapse Fires on the tree when an expanded tree node is collapsed. Expand Fires on the tree when a collapsed tree node is expanded. SelectedIndexChange Fires when the user changes the selected TreeNode on the TreeView.
Method Description AddParsedSubObject Adds a TreeNode to the TreeNodeCollection or a TreeNodeType to the TreeNodeTypeCollection. ClickEventHandler Delegate for click events. CreateControlCollection Creates an EmptyControlCollection object to prevent controls from being added to the ControlCollection. 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. LoadViewState Loads the item's previously saved view state. OnCheck Fires the Check event on the TreeView object. OnCollapse Fires the Collapse event on the TreeView object. OnExpand Fires the Expand event on the TreeView object. OnInit Initializes the object. OnLoad Loads the object. OnPreRender Raises the PreRender event. OnSelectedIndexChange Fires the SelectedIndexChange event on the TreeView object. ProcessData Processes post-back data for the server control from the hidden helper's data. RaisePostBackEvent Parses and processes the event arguments passed from the client when the Web form is submitted. RenderContents Renders the contents of the control into the specified HtmlTextWriter. RenderDesignerPath Implements the rendering path for the Microsoft Visual Studio .NET Editor. RenderDownLevelPath Implements the downLevel rendering path in this method. RenderUpLevelPath Implements the uplevel rendering path for this method. SaveViewState Saves changes to the item's view state to an object. SelectEventHandler Delegate for selection events. TrackViewState Instructs the control to track changes to its view state.
Class Information
Namespace Microsoft.Web.UI.WebControls Assembly Microsoft.Web.UI.WebControls.dll
See Also
Internet Explorer WebControls, About the TreeView WebControl