System.Web.UI.WebControls.TreeView.NodeStyle Property

Gets a reference to the System.Web.UI.WebControls.TreeNodeStyle object that allows you to set the default appearance of the nodes in the System.Web.UI.WebControls.TreeView control.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)]
[System.ComponentModel.DefaultValue(null)]
[System.ComponentModel.NotifyParentProperty(true)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public TreeNodeStyle NodeStyle { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the TreeView.NodeStyle property to control the default appearance of a node in the System.Web.UI.WebControls.TreeView control. This property is read-only; however, you can set the properties of the System.Web.UI.WebControls.TreeNodeStyle object it returns. The properties can be set declaratively in the form Property-Subproperty, where Subproperty is a property of the System.Web.UI.WebControls.TreeNodeStyle object (for example, NodeStyle-ForeColor). The properties can also be set programmatically in the form Property.Subproperty (for example, NodeStyle.ForeColor). Common settings usually include a custom background color, foreground color, font properties, and node spacing. Style properties are applied in the following order of precedence:

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

The corresponding node style settings in the TreeView.RootNodeStyle, TreeView.ParentNodeStyle, or TreeView.LeafNodeStyle properties override the style settings of the TreeView.NodeStyle property.

If you need to generate table of contents-style navigation menus where nodes at a certain level should have the same appearance, regardless of whether they have child nodes, you might consider using the TreeView.LevelStyles property instead of setting the individual style properties.

Requirements

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