Tree with style (C#) : Tree « Components « ASP.Net

Home
ASP.Net
1.ADO.net Database
2.Ajax
3.Asp Control
4.Collections
5.Components
6.Data Binding
7.Development
8.File Directory
9.HTML Control
10.Language Basics
11.Login Security
12.Mobile Control
13.Network
14.Page
15.Request
16.Response
17.Server
18.Session Cookie
19.Sitemap
20.Theme Style
21.User Control and Master Page
22.Validation by Control
23.Validation by Function
24.WebPart
25.WPF
26.XML
ASP.Net » Components » Tree 
Tree with style (C#)

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <style type="text/css">
        .treeNode
        {
            color:blue;
            font:14px Arial, Sans-Serif;
        }
        .rootNode
        {
            font-size:18px;
            width:100%;
            border-bottom:Solid 1px black;
        }
        .leafNode
        {
            border:Dotted 2px black;
            padding:4px;
            background-color:#eeeeee;
            font-weight:bold;
        }
    </style>
    <title>TreeView Styles</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <asp:TreeView
        id="TreeView1"
        NodeStyle-CssClass="treeNode"
        RootNodeStyle-CssClass="rootNode"
        LeafNodeStyle-CssClass="leafNode"
        Runat="server">
        <Nodes>
        <asp:TreeNode
            Text="Home">
            <asp:TreeNode Text="Products">
                <asp:TreeNode Text="First Product" />
                <asp:TreeNode Text="Second Product" />
            </asp:TreeNode>
            <asp:TreeNode Text="Services">
                <asp:TreeNode Text="First Service" />
                <asp:TreeNode Text="Second Service" />
            </asp:TreeNode>    
        </asp:TreeNode>    
        </Nodes>
    </asp:TreeView>    
    
    
    </div>
    </form>
</body>
</html>

           
       
Related examples in the same category
1.IE control tree with link node and frame control (C#)
2.IE control treeview with link node (C#)
3.Static WebControls treeview (VB.net)
4.Treeview with custom icon (VB.net)
5.treeview with expand, collapse and change action (VB.net)
6.Treeview with navigational URL (VB.net)
7.Working with TreeNode Controls in a TreeView Control (VB.net)
8.Setting Styles in a TreeView Control (VB.net)
9.Tree Node selected event in a TreeView (VB.net)
10.Using Links with TreeNode Controls in a TreeView Control (VB.net)
11.Using Images with TreeNode Controls in a TreeView Control (VB.net)
12.TreeNode Expand action (VB.net)
13.TreeNode Collapses action (VB.net)
14.Treeview and checkbox treenode (VB.net)
15.On Tree Node Populate Event (C#)
16.Add tree node (C#)
17.Tree node with hyper link (C#)
18.Treeview image: XP file explore style (C#)
19.Tree view node style (C#)
20.On tree node selection changed event (C#)
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.