ScG
ScG

Reputation: 1073

TreeView Root Node Style

I have a tree view

<asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" 
    ShowExpandCollapse="False">

</asp:TreeView>

As you can see, root node is hidden. However when the treenode gets rendered, there is a whitespace to the left of each leafnode. This is probably because the root node is hidden but is taking up space. How do i remove that white space.

Upvotes: 2

Views: 2704

Answers (1)

citronas
citronas

Reputation: 19365

Had the same problem. This one works for me:

<asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" CssClass="foo"
        ShowExpandCollapse="False">
    </asp:TreeView>

Css

.foo table tbody tr td:first-child  
{   
   display:none;   
}  

Upvotes: 1

Related Questions