C1FlexGrid: Delay for Cell Labels

Posted by: wknauf on 10 January 2018, 7:05 am EST

    • Post Options:
    • Link

    Posted 10 January 2018, 7:05 am EST

    Hi C1,

    when a C1FlexGrid has “ShowCellLabels = true”, then the tooltips are show immediately. I would prefer a small delay, just as with a WinForms ToolTip.

    This is probably not possible in the moment.

    Do you (and other users) think it would make sense to add some property “CellLabelsToolTipDelay” this to the control?

    Best regards

    Wolfgang

  • Posted 10 January 2018, 1:59 pm EST

    Hi Wolfgang,

    You may show tooltip with some delay for each C1FlexGrid cell, by setting the UserData for each cell (using e.Text) in OwnerDrawCell event and then show a tooltip for the cell and set its tooltip by accessing this UserData in MouseMove event as follows:

    private void c1FlexGrid1_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
            {
                if (!e.Measuring && e.Row >= this.c1FlexGrid1.Rows.Fixed && e.Col >= this.c1FlexGrid1.Cols.Fixed)
                {
                    this.c1FlexGrid1.SetUserData(e.Row, e.Col, e.Text);
                }    
            }
    private void c1FlexGrid1_MouseMove(object sender, MouseEventArgs e)
            {
                if(c1FlexGrid1.MouseRow>0 && c1FlexGrid1.MouseCol>0)
                {
                    string tip;
                    tip = (string)this.c1FlexGrid1.GetUserData(c1FlexGrid1.MouseRow, c1FlexGrid1.MouseCol);
                    toolTip1.SetToolTip(c1FlexGrid1, tip);
                }
            }
    

    Let me know if that is satisfactory for you !

    Thanks,

    Ruchir Agarwal

  • Posted 11 January 2018, 3:59 am EST

    Hi Ruchir,

    this would work, but we have a lot of grids in our app, all inherited from a base class. I would prefer a simple “change one property” solution, so it would be best if you could add a configureable delay to C1FlexGrid ;-).

    The Tooltip approach will probably not work as expected, because the tooltip will not be re-shown for other cells after being shown for the first cell. It will only be reshown when the coursor moves out of the grid and back.

    We had already created a small component which handle this situation (used for special grids where we have custom tooltips for specific cells), but as I wrote before: it would be a bit of work to add this to all our grids.

    Best regards

    Wolfgang

  • Posted 11 January 2018, 5:25 am EST

    Hi Wolfgang,

    The ToolTip approach we suggested will work for all cells and the tooltip would be shown with modified values as the mouse moves over them (without going out of grid bounds). Please refer attached video file showing the same.

    Anyhow, for your convenience we have forwarded your requirement to the concerned team [Tracking ID: 304787] and it might be added in the future builds, if they find it feasible.

    Thanks,

    Ruchir Agarwal

    C1FlexGrid_CellLabelDelay.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels