| |||||||
TreeView.LevelStyles PropertySystem.Web.UI.WebControls Namespace TreeView Class .NET Framework version 2.0 Returns a collection of TreeNodeStyle objects that represent the node styles at the individual levels of a TreeView control. Syntax
Property Value
The property is read/write with no default value. RemarksUse the LevelStyles collection as an alternative to using the NodeStyle, RootNodeStyle, ParentNodeStyle, or LeafNodeStyle properties to control the style of TreeView nodes at the individual levels of the tree structure. The styles contained in this collection are applied to the nodes based on their level in the tree. The first style in the collection corresponds to the style of nodes in the first level of the tree. The second style in the collection corresponds to the style of nodes in the second level of the tree, and so on. This collection is most often used to generate a table of contents-style navigation TreeView where nodes at a certain level should have the same appearance.
ExampleThe following example shows how to use the LevelStyles collection to apply style settings to the nodes in a TreeView control based on their level. <asp:treeview id = "myTreeView" runat = "server"
datasourceid = "siteMap"
nodeindent=0
expanddepth=1>
<levelstyles>
<asp:treenodestyle width=100%
font-size = "10pt" font-bold
verticalpadding=3
backcolor = "steelblue"
forecolor = "beige"
borderwidth=1
borderstyle = "outset" />
<asp:treenodestyle width=100%
font-size = "10pt" font-bold
verticalpadding=3
backcolor = "steelblue"
forecolor = "beige"
borderwidth=1
borderstyle = "outset" />
<asp:treenodestyle width=100%
font-size = "9pt"
backcolor = "ghostwhite"
forecolor = "maroon" />
<asp:treenodestyle width=100%
font-size = "8pt"
backcolor = "whitesmoke" />
</levelstyles>
</asp:treeview>
<asp:sitemapdatasource id = "siteMap" runat = "server" />
See Also |
| ||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme