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
Can you set a tooltip on a GridControl at design time?
Answers
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
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.
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.