Ticket T850640
Visible to All Users

Can you set a tooltip on a GridControl at design time?

created 5 years ago

As the title says, I can't seem to figure out how to set a tooltip on a GridControl in the designer. You can assign it a ToolTipController but that doesnt seem to provide the option either. If I use my tooltipcontroller to SetToolTip(myGridControl, "test") in code, it works. We are on version 19.1, please let me know if this is possible. Attached is what I see in the properties of my gridcontrol

Answers

created 5 years ago (modified 5 years ago)

Hello,

Our GridControl does not have a property to set a tooltip at either at design time or runtime. Thus, the approach with the SetToolTip method is the best way to complete this task. As an alternative, I suggest that you handle the GetActiveObjectInfo event.

If setting a tooltip at design time is vital for you, consider creating a custom data grid (see Template Gallery) and adding this feature at the descendant level:

C#
public class CustomGridControl : GridControl { public string ToolTip { get; set; } public CustomGridControl() { } protected override void OnEndInit() { this.GetToolTipController()?.SetToolTip(this, ToolTip); base.OnEndInit(); } protected override BaseView CreateDefaultView() { return CreateView("CustomGridView"); } protected override void RegisterAvailableViewsCore(InfoCollection collection) { base.RegisterAvailableViewsCore(collection); collection.Add(new CustomGridViewInfoRegistrator()); } }

It is not entirely clear, however, why it is necessary to set a tooltip for the whole control. Would you please describe your scenario so that I can pass this information to our developers? I look forward to hearing back from you.

See also:
How to create a GridView descendant class and register it for design-time use

    Comments (2)

      After a few tweaks this code achieved my desired functionality, thank you! I've seen a lot of articles on this forum about putting tooltips on specific columns, rows, or cells. In contrast, I want to have a tooltip that appears anywhere on my grid control to say something along the lines of "this grid control displays x, y, and z". I'd also like it to be at design time since thats where our developers set the tooltips on any other control. Now, when I click on my grid control, the attached image shows what I see. Adding the tooltipcontroller (named toolTipProvider here) that we use for setting tooltips on all other controls also applies the formatting to this tooltip property we made.

      Sasha (DevExpress Support) 5 years ago

        Hi,

        I am happy to hear that you have managed to implement the required functionality. We also appreciate that you've taken the time to describe your scenario. We will take it into account when planning our future releases.

        Should you have further questions, feel free to contact us.

        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.