Trouble adjusting the vertical spacing between nodes in ASP.NET TreeView

I am using a TreeView control on my webpage and populating the nodes dynamically.  I want to decrease the vertical spacing between nodes but can't figure out the correct paramter to set.  Here is the code I have that doesn't seem to have an effect:

    <asp:TreeView ID="tvAlignment" runat="server" EnableClientScript="true"
        PopulateNodesFromClient="true" OnTreeNodePopulate="PopulateNode"
        ImageSet="Arrows" ExpandDepth="1">
        <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
        <Nodes>
            <asp:TreeNode PopulateOnDemand="True" SelectAction="Expand"
                Text="Alignment" Value="0">
            </asp:TreeNode>
        </Nodes>
        <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black"
            HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" />
        <ParentNodeStyle Font-Bold="False" VerticalPadding="0px" />
        <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD"
            HorizontalPadding="0px" VerticalPadding="0px" />
    </asp:TreeView>

I set the VerticalPadding to 0px in both the NodeStyle and ParentStyle tags.  Any help is greatly appreciated.
dyaroshAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jitendra PatilSr.Software EngineerCommented:
try with the below link
Redude the gap between Nodes in a ASP.NET TreeView

please scroll down for solution.

hope this helps.
0
dyaroshAuthor Commented:
I looked at the link and did the inspect and this is what I found:

The table has a class definition as follows: class="dynamiccontainer_onebox_onebox_tvAlignment_0 dynamiccontainter_onebox_onebox_tvAlignment_1"

While inspecting the element it looks like it is adding spacing or padding (not really sure) but I can't find the CSS file that contains the class.
TreeView.JPG
0
Bob LearnedCommented:
You should be able to use an inspector, like Google Chrome, FireBug, or IE Developer Tools, to inspect the page, and determine what CSS styles are applied to each element in the DOM.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dyaroshAuthor Commented:
Using Chrome I did an Inspect on the the treeview table that is rendered and discovered that a padding of 20px was being added to the top and bottom of each <td> tag.  Since applying a style sheet to the TreeView didn't solve the problem I added the following to my Style Sheet and wrapped my TreeView in a <Div> with the specified ID.

#treeView td
{
    padding: 2px 0px 1px 0px !important;
}

This gave me the spading I wanted.  The !important indicator is what allowed the style to be applied to all levels of the TreeView.

Thanks for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.