peneloppus
0
Q:

devexpress winforms how to get tooltip over treelist cell

public void Init()
{
  TreeList.ToolTipController = toolTipController1;
  toolTipController1.Active = true;
  toolTipController1.GetActiveObjectInfo += toolTipController1_GetActiveObjectInfo;
}

void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)  
{  
    if (e.SelectedControl.Name == "treeList1")  
    {  
        DevExpress.Utils.SuperToolTip superToolTip = new DevExpress.Utils.SuperToolTip();  
        DevExpress.Utils.ToolTipItem toolTipItem = new DevExpress.Utils.ToolTipItem();  
        toolTipItem.Text = "TestContent";  
        superToolTip.Items.AddTitle("TestTitle");  
        superToolTip.Items.Add(toolTipItem);  
        superToolTip.Items.AddSeparator();  
        superToolTip.Items.AddTitle("TestTitle");  
        DevExpress.Utils.ToolTipControlInfo myInfo = new DevExpress.Utils.ToolTipControlInfo();  
        myInfo.SuperTip = superToolTip;  
        DevExpress.XtraTreeList.TreeListHitInfo hi = treeList1.CalcHitInfo(e.ControlMousePosition);  
        if (hi.Node != null && hi.Column != null)  
        {  
            string value = hi.Node.Id.ToString() + hi.Column.FieldName;  
            toolTipItem.Text = hi.Node.GetValue(hi.Column.FieldName).ToString();  
            myInfo.Object = value;
        }  

        e.Info = myInfo;  
    }  
}  
0

New to Communities?

Join the community