views:

199

answers:

1

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.

A: 

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;   
}  
citronas
this works perfectly fine. Thanks for your code citronas
ScG