2009-09-09 11:33
by
海洋——海纳百川,有容乃大.,
72
visits,
网摘,
收藏,
编辑
Synopsis:
Microsoft's Treeview Webcontrol does not have a tooltip which works on a per node level. Here are two solutions to the problem.
Solution:
The first and easiest method is to put an <acronym> tag around the text in any node for which you want a tooltip: Me.TreeView1.Nodes(0).Text = "<acronym title=""This is the tooltip"">" & _
"This is the node text</acronym>"
Another method is to modify the htc file for the treeview control which should be located in a webctrl_client folder under the wwwroot folder. Replace:
if (nodeClass == "parent" && element.getAttribute("showToolTip") != false)
accessAnchor.title = textNode.innerText + " : " + L_strToolTip_Text;
With: var tooltiptext= el.getAttribute("NodeData");
//if (nodeClass == "parent" && element.getAttribute("showToolTip") != false)
if (tooltiptext != null)
{
accessAnchor.title = tooltiptext;
}With this replacement the nodedata will be displayed a the tooltip.