Last post Feb 19, 2007 08:07 PM by wahyu
Feb 08, 2007 10:51 PM|wahyu|LINK
Hi, i'm using the SimpleEntertainmentTreeview class. How can i set the color for a class like the one populated by the adapter:
the last node is always the one that i want to have a different color. Other thing is that i don't know how to assign value to a class name like "AspNet-TreeView-Parent AspNet-TreeView-Selected", is this a valid class name (with white space)?
Feb 09, 2007 05:02 PM|Russ Helfand|LINK
Chris has done some interesting work lately that you should examine,
http://forums.asp.net/thread/1557885.aspx. He has added code that marks the last child of each group of children with a special class, lastChild. (He also marks the first child, using firstChild). These are CSS classes and should show up in your HTML markup
just like AspNet-TreeView-Leaf or AspNet-TreeView-Selected. It seems like Chris' enhanced version of the tree view adapter should give you the flexibility that you are asking for.
You also asked if a space is allowed between two classes:
<sometag class="foo bar" />
The answer is "yes." Tags in HTML are allowed to have any numberr of classes simultaneously assigned to them. In the example shown above the sometag tag has the foo class applied and then has the bar class applied, too. If foo and bar both define the same
CSS property then the value in the bar class is the one that is used because it is last in the list.
This is called putting "multiple classes" on a tag. There have been several discussions on this forum (during the early development of these adapters) soliciting community feedback on whether or not folks thought that using multiple classes was OK. Some
browsers don't handle multiple classes 100% correctly in every case. So folks were discussing whether, on whole, the technique is OK to use. The overwhelming concensus was that, despite the occasional browser bug, the use of multiple classes is a good technique
when (as is the case with the adapters) is solves hard problems much more gracefully than would be possible if all tags were limited to using just one class.
Hope this helps...
Feb 19, 2007 08:07 PM|wahyu|LINK