Dev's treelist add tooltip information

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.