Home All Groups Group Topic Archive Search About

.NET 2.0 TreeView control vertical align problem

Author
5 Apr 2006 11:28 PM
shelly
Each node's text is two lines, and I want the expand image to align
with top vertically.
Right now, it's aligned in the middle. I've looked through all
properties of the treeview, but couldn't find one. Please help help
help.

Author
28 Jun 2006 3:34 PM
chinkchink
shelly wrote:
> *Each node's text is two lines, and I want the expand image to align
> with top vertically.
> Right now, it's aligned in the middle. I've looked through all
> properties of the treeview, but couldn't find one. Please help help
> help. *


To accomplish what you are looking for, this is what I did:

1. give the tree view a cssstyle:

tree.ControlStyle.CssClass = "TreeControl"


2. create the css class in the style sheet as follow:

div.TreeControl table td { vertical-align:top; }


Hope this help -- chinkchink ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------
Author
28 Jun 2006 3:44 PM
chinkchink
chinkchink wrote:
> * *

Oops! hit the submit button too soon...

revised post:

1. give the treeview a css class:
Code: --------------------  
  treeview1.ControlStyle.CssClass = "TreeControl"
  --------------------

2. create the css class in the style sheet as follow:
Code: --------------------  
  div.TreeControl table td { vertical-align:top; }
  --------------------
This will top align all elements inside all table cells within the treeview control



Hope this help -- chinkchink ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------