Skip to main content

ToolTip Popup event

Comments

1 comment

  • Dapfor Team

    Hello,
    There are two methods to display a tooltip:
    1. As you said by pre-filling data in the Cell.TooltipMessage property
    2. By calling the Grid.Tooltips.ShowTooltip() method.

    In the second case the grid doesn't keep text data per cell which optimizes memory using. The best location to call this method is in the Grid.CellEnter event handler:

    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    grid1.CellEnter += grid1_CellEnter;
    for(int i = 0; i < 10; ++i)
    {
    string[] data = new string[10];
    for(int j = 0; j < 10; j++)
    {
    data[j] = "item " + i + "," + j;
    }
    grid1.Rows.Add(data);
    }
    }

    void grid1_CellEnter(object sender, Dapfor.Net.Ui.GridCellEventArgs e)
    {
    //Here you can change other parameters of the tooltip like colors, orientation etc...
    grid1.Tooltips.ShowTooltip(e.Cell, string.Format("{0}: This is a custom message", e.Cell.Text), TimeSpan.FromSeconds(5));
    }
    }

    You can find the full example in attachments
    Best regards,
    The Dapfor Team




    TooltipDemo.zip
    0

Please sign in to leave a comment.

Powered by Zendesk