Ticket Q583878
Visible to All Users

How to show a tooltip over a TreeList node using ToolTipController

created 11 years ago

Hi,

I have difficulties trying to use toolTipController with Treelist.
I add a tooltipcontroller to my form, and assign Tootilcontroller treelist's property to it.
AllowHtmlText is set to true, TooTipType is set to supertip.
Then I add that code

C#
void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { if (e.SelectedControl.Name == "treeListAdresses") { DevExpress.Utils.SuperToolTip superToolTip = new DevExpress.Utils.SuperToolTip(); DevExpress.Utils.ToolTipItem toolTipItem = new DevExpress.Utils.ToolTipItem(); toolTipItem.Text = myContent; superToolTip.Items.AddTitle(myHeader); superToolTip.Items.Add(toolTipItem); superToolTip.Items.AddSeparator(); superToolTip.Items.AddTitle(myFooter); DevExpress.Utils.ToolTipControlInfo myInfo = new DevExpress.Utils.ToolTipControlInfo (); myInfo.SuperTip = superToolTip; e.Info = myInfo ; } }

Tooltips are never shown, what am I missing ?

Regards

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hi Thomast,
It is necessary to set the ToolTipControlInfo.Object property. I have created a test sample to illustrate how it works. Feel free to contact me if you have any further questions.

    Show previous comments (3)
    DevExpress Support Team 11 years ago

      You're welcome. We are always happy to help you.

      EA EA
      Eric Adolphson 7 years ago

        I used the SImpleTreeListProject.zip file to get my tree list tool tips to work.

        Thanks.

        The one thing I do not understand is setting the
          myInfo.Object = value;
        line of code.

        C#
        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; // <--- THIS LINE HERE. WHAT DOES IT DO? WHY DO I NEED IT? } e.Info = myInfo; } }

        What does it do?

        DevExpress Support Team 7 years ago

          Hello Eric,

          This property is used to identify a currently processed element. Please refer to the GetActiveObjectInfo and ToolTipControlInfo.Object articles for additional information in this regard and let me know if anything remains unclear. I will elaborate on these points.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.