Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I am binding a grid to a datatable and would like to display a tooltip (stored as a non-visible column in the grid) ro the entire row as I hover the cursor over it. How do I either do this or to manually select the data from the underlying database for the record (grid row) that I'm hovering over at the time. What is the best way to accomplish this.

                                1 Solution

                                Creation Date Rating Importance Sort by
                                0

                                You could place a ToolTipController component onto your form and set the GridControl's ToolTipController property to this new instance. Handle the ToolTipController's GetActiveObjectInfo event, get your DataRow, and construct the tool tip to be displayed. For instance:

                                [C#]
                                private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { if (e.SelectedControl != gridControl1) return; GridHitInfo hitInfo = gridView1.CalcHitInfo(e.ControlMousePosition); if (hitInfo.InRow == false) return; SuperToolTipSetupArgs toolTipArgs = new SuperToolTipSetupArgs(); toolTipArgs.Title.Text = "This is my title"; //Get the data from this row DataRow drCurrentRow = gridView1.GetDataRow(hitInfo.RowHandle); if (drCurrentRow != null) { string BodyText = String.Format("Employee Name: {0}\r\nEmployee Type: {1}", drCurrentRow["EmployeeName"], drCurrentRow["EmployeeType"]); toolTipArgs.Contents.Text = BodyText; } e.Info = new ToolTipControlInfo(); //<bold>Updated by John (DevExpress Support):</bold> //e.Info.Object = hitInfo.Column; e.info.Object = hi.HitTest.ToString() + hi.RowHandle.ToString(); //NewLine //<bold>End Update</bold> e.Info.ToolTipType = ToolTipType.SuperTip; e.Info.SuperTip = new SuperToolTip(); e.Info.SuperTip.Setup(toolTipArgs); }

                                Show all comments
                                • David Beechey 11.18.2012

                                  Hi Brendon,

                                  That worked great exept sometimes moving to another row after a tooltip is shown for the previous row the grid does not show the new rows tool tip.

                                  Thanks

                                • The cause of the problem is that the e.Info.Object property contains an object that uniquely identifies the currently processed element. In the previously posted code this property was set to the grid's column, thus the tooltip created the entire column and did not change until you left it.
                                  To solve this problem, it is necessary to provide a unique object for each cell. To achieve this, modify the previous code in the following manner:

                                  [C#]
                                  //e.Info.Object = hitInfo.Column; e.info.Object = hi.HitTest.ToString() + hi.RowHandle.ToString(); //NewLine
                                • David Beechey 11.19.2012

                                  Thank you. That resolved the issue.

                                • Kushan Randima 10.13.2014

                                  Hi,

                                  This works for me too. Thanks a lot for the post. But the tool tip is not changing while I'm moving the cursor on the same row. (moving Horizontally). But if I leave the row and come back, then the tool tip changes. Please advice me.

                                  Thanks for helping,
                                  Kushan Randima.
                                  Software Engineer
                                  Davton Ltd

                                • Demetrius (DevExpress Support) 10.13.2014

                                  Hi Kushan,

                                  According our documentation, the ToolTipControlInfo.Object property of the e.Info parameter in the ToolTipController.GetActiveObjectInfo event handler should be set to a value that uniquely identifies the current element.

                                  In your scenario, you can add the GridColumn.FieldName (hi.Column.FieldName) to the e.info.Object to change the tooltip for row cells and/or hi.HitPoint if you wish to change a tooltip while moving it to a row cell.

                                • Kushan Randima 10.14.2014

                                  Thanks. I solved the problem according to your comments.

                                • Demetrius (DevExpress Support) 10.14.2014
                                  You are always welcome, Kushan. Should you have further questions, we are always happy to help.
                                • qadeem akhtar 07.27.2015

                                  my toolTipController1_GetActiveObjectInfo event is not executing ....
                                  can you tell me that how fix this issue?????

                                • Hello, 
                                  Please ensure that the GridControl.ToolTipController property is set to your ToolTipController instance. If this does not help, send us a sample project that illustrates your scenario. 
                                  I am looking forward to your results. 

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners