Article reprinted from: DevExpress Control Chinese web [http://www.devexpresscn.com/]
You can use the Tooltipcontroller control and then set the ToolTip through the Tooltipcontroller.getactiveobjectinfo event
Key code:
private void Tooltipcontroller1_getactiveobjectinfo (object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { if (E.selectedcontrol is DevExpress.XtraTreeList.TreeList) { treelist tree = (treelist) E.selectedcontrol; Treelisthitinfo hit = tree. Calchitinfo (e.controlmouseposition); if (hit. Hitinfotype = = Hitinfotype.cell) { Object cellinfo = new Treelistcelltooltipinfo (hit. Node, hit. Column, null); String ToolTip = String. Format ("{0} (Column: {1}, Node ID: {2})", hit. Node[hit. Column], hit . Column.visibleindex, hit. node.id); E.info = new DevExpress.Utils.ToolTipControlInfo (Cellinfo, ToolTip);}}
I have a tree list of only one column of values, the tree data is a first-level area, level two sub-region, level three devices, and prompt information as long as the level three device prompts the connection status
Use the tag value of the Treelist node as the cue message value, add the tag value of the node of level three device only in the Treelist bound value event, and modify some code in the event
if (hit. Hitinfotype = = Hitinfotype.cell) { if (hit. Node.tag = = null) return; Object cellinfo = new Treelistcelltooltipinfo (hit. Node, hit. Column, null); String ToolTip = String. Format ("{0}", hit. Node.Tag.ToString ()); E.info = new DevExpress.Utils.ToolTipControlInfo (Cellinfo, TOOLTIP);}
That is, the one or two-level node does not display the ToolTip, and the three-level node displays the ToolTip
Dev's treelist add tooltip information