Ticket Q537126
Visible to All Users

XtraGrid tooltips in cells when editor is active.

created 11 years ago

I have successfully implemented tooltips for individual cells by handling the GetActiveObjectInfo event of the tooltipcontroller. This works fine. I also want to have the same tooltips displayed when an editor is active. I read this article:
http://www.devexpress.com/Support/Center/Question/Details/A2008
This also works. However, when the editor is active, the other tooltips don't work.
So it seems I can have one or the other, but not both. Is there a way to do this?
Also, how can I find out which column the active editor is on?

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hello Brian,
To implement tool tips for the GridContol and its active editor it is necessary to create an additional condition in the GetActiveObjectInfo event handler:

C#
private void ToolTipController_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { ToolTipControlInfo info = null; GridHitInfo hInfo = gridView1.CalcHitInfo(e.ControlMousePosition); Debug.WriteLine(hInfo.HitTest); if (!(e.SelectedControl is GridControl)) { object o = gridView1.ActiveEditor.ToString(); string text = "Test"; info = new ToolTipControlInfo(o, text); e.Info = info; } else { if (hInfo.InRowCell) { string text = gridView1.GetRowCellDisplayText(hInfo.RowHandle, hInfo.Column); info = new ToolTipControlInfo(gridControl1, text); e.Info = info; } } }

I have attached my test sample to illustrate this approach in detail. I hope you will find it useful.

    Comments (2)

      That worked. I'm not sure I know what I did differently that broke it, but your solution works.

      DevExpress Support Team 11 years ago

        I'm glad to hear that my assistance was helpful to you. We are always happy to help you.

        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.