TreeNodeStyleCollection Class
Represents a collection of TreeNodeStyle objects that is in a TreeView control.
Assembly: System.Web (in System.Web.dll)
The TreeNodeStyleCollection class is used to store and manage a collection of TreeNodeStyle objects. The LevelStyles property, of type TreeNodeStyleCollection, stores the node styles for the individual levels of a tree.
The LevelStyles property is an alternative to the individual style properties, such as the NodeStyle property, that control node styles at different levels of the tree. The first style in the collection corresponds to the node style in the first level of the tree. The second style in the collection corresponds to the node style in the second level of the tree, and so on. The LevelStyles property is most often used 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.
The TreeNodeStyleCollection class inherits most of its members from the StateManagedCollection class. For more information about the inherited members, see StateManagedCollection.
The following code example demonstrates how to use the TreeNodeStyleCollection class to specify the style settings for the individual levels of a TreeView control. Notice that the LevelStyles property returns a TreeNodeStyleCollection object.
System.Web.UI::StateManagedCollection
System.Web.UI.WebControls::TreeNodeStyleCollection
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.