Hello Danny,
Thanks for taking your time to look at this. Your reply convinced me that this way of doing it should work and that it was something I was doing wrong. Your example was working so why wasn't mine ? And what a stupid mistake it was ! During my tests I was using :
writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "
Grey")
"Grey" is not an
official CCS color (and English is not my native language
![Smile [:)]](/emoticons/emotion-1.gif)
). This should have been :
writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "
Gray")
Normally I should have discovered this mistake early but the problem was that Firefox recognizes "Grey". And so the rendered html :
<a class="TreeView2_0 TreeView2_1" href="javascript:__doPostBack('TreeView2','sroot')" onclick="TreeView_SelectNode(TreeView2_Data, this,'TreeView2t0');" id="TreeView2t0" style="background-color:green;
color:Grey;">root</a>
changed the color of the TreeNode text in Firefox but not in IE which lead me to the wrong conclusion that in IE class="TreeView2_0 TreeView2_1" takes precedence over style="background-color:green;color:Grey;" and in Firefox it is the other way around. Totally wrong.
So thanks a lot, I will continue working in this direction (with the suggestions you made). Have a great New Year and all the best wishes for 2006 !