Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i just want apply styles for tree view control in asp.net

when mouse over on node i need to show one color

show diff color for selected node (child/root/parent)

which gives info about selected node

can any one help me
Posted

Use this one

CSS
.AspNet-TreeView {
    width: 200px;
    border-top: solid 1px #DDD;
}
 
.AspNet-TreeView ul {
    list-style: none; 
}
 
.AspNet-TreeView-Leaf {
    border-bottom: solid 1px #DDD;
    background: url(../../images/structure/node-dot.gif) 8px 9px no-repeat;  
}
 
.AspNet-TreeView-Root {
    border-bottom: solid 1px #DDD; 
}
 
.AspNet-TreeView-Root a {
    display: block;
    width: 170px;
    margin-left: 20px;
    padding: 5px 5px 5px 5px; 
}
 
.AspNet-TreeView-Selected {
    background: #F6F6F6 url(../../images/structure/arrow-right.gif) 8px 9px no-repeat;
}
 
.AspNet-TreeView-Expand {
    display: block;
    float: left;
    margin: 9px 0px 0px 8px;
    padding: 6px 4px 5px 4px;
    height: 0px !important;
    background: url(../../images/structure/node-plus.gif) 0px 0px no-repeat;
    cursor: pointer;
}
 
.AspNet-TreeView-Collapse {
    display: block;
    float: left;
    margin: 9px 0px 0px 8px;
    padding: 6px 4px 5px 4px;
    height: 0px !important;
    background: url(../../images/structure/node-minus.gif) 0px 0px no-repeat;
    cursor: pointer;
}
 
.AspNet-TreeView-Show li {
      border-top: solid 1px #DDD;
      background-position: 28px 9px;
}
 
.AspNet-TreeView-Hide {
    display: none;
}
 
.AspNet-TreeView ul li ul li {
    text-indent: 20px;
    border-bottom: none;
    font-size: 11px;
}
 
Share this answer
 
Simply create CSS classes & then apply to nodes, sub-nodes & tree-view. That's all. Check these

Treeview with style[^]
Tree view node style[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900