applying css formats to asp.net 2.0 treeview control

S

schneider

Hi all,

I'm trying to create a nice navigation for an asp.net 2.0 website.
What I want to do is use css to define the look of the tree. My
problem is that I cannot set margins or paddings via css. I want to
create a gap between top-level nodes, however not between a top-level
node and its first child (which I set always visible). I defined css
classes like "navi_level0", "navi_level1", ... in my css file and set
the CssClass properties in the corresponding TreeNode's LevelStyles.
Applying colors, font-sizes etc. works fine, but since the TreeView
control does only render my previously defined css classes to the <td>
elements and not to any enclosing <div> or <table> tags, I remain
helpless with css since I can define margin only for <table> and <div>
tags.
My next approach was using the VerticalPadding, NodeSpacing and Height
properties of the corresponding LevelStyle. But here, the value is
applied both at the top and at the bottom of the element, rendering a
gap above AND below each top-level node. Is there any workaround or is
this control not css formattable?
Would it be possible to create a custom class derived from the
TreeView class?
Thanks in advance.

Cheers, Hannes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top