System.Web.UI.WebControls.TreeNodeStyle Class

Represents the style of a node in the System.Web.UI.WebControls.TreeView control.

See Also: TreeNodeStyle Members

Syntax

public sealed class TreeNodeStyle : Style

Remarks

Use the System.Web.UI.WebControls.TreeNodeStyle class to represent the style of a node in the System.Web.UI.WebControls.TreeView control. The System.Web.UI.WebControls.TreeView control allows you to specify different style characteristics (such as font size and color) for each of the different node types.

The following table lists the node styles that are supported by the System.Web.UI.WebControls.TreeNodeStyle class.

TreeView.HoverNodeStyle

The style settings for a node when the mouse pointer is positioned over it.

TreeView.LeafNodeStyle

The style settings for the leaf nodes.

TreeView.NodeStyle

The default style settings for a node.

TreeView.ParentNodeStyle

The style settings for the parent nodes.

TreeView.RootNodeStyle

The style settings for the root node.

TreeView.SelectedNodeStyle

The style settings for a selected node.

When you set the node style properties of the System.Web.UI.WebControls.TreeView control, they are applied in the following order:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

The System.Web.UI.WebControls.TreeNodeStyle class inherits most of its members from the System.Web.UI.WebControls.Style class. It extends the System.Web.UI.WebControls.Style class by providing properties that control the amount of space around the text in a node, as well as the space between adjacent nodes. Use the TreeNodeStyle.HorizontalPadding property to control the amount of space to the left and right of the text in a node. Similarly, the TreeNodeStyle.VerticalPadding property controls the amount of space above and below the text in a node. You can control the amount of spacing between the node that the System.Web.UI.WebControls.TreeNodeStyle is applied to and its adjacent nodes by setting the TreeNodeStyle.NodeSpacing property. To control the amount of spacing between a parent node and a child node, use the TreeNodeStyle.ChildNodesPadding property.

For more information about the inherited style settings, see System.Web.UI.WebControls.Style.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0