New to Telerik UI for WinFormsStart a free 30-day trial

ToolTips

Updated over 6 months ago

There are two ways to assign tooltips to cells in RadVirtualGrid, namely setting the ToolTipText property of a VirtualGridCellElement in the CellFormatting event handler, or as in most of the RadControls by using the ToolTipTextNeeded event.

Setting tooltips in the ToolTipTextNeeded event

The code snippet below demonstrates how you can use the ToolTipTextNeeded event handler to set ToolTipText for the given VirtualGridCellElement.

WinForms RadVirtualGrid Setting tooltips in the ToolTipTextNeeded event

C#
        
private void radVirtualGrid1_ToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
{
    VirtualGridCellElement virtualCell = sender as VirtualGridCellElement;
    if (virtualCell != null)
    {
        e.ToolTipText = "Tooltip: " + virtualCell.Value + "";
    }
}

Setting tooltips in the CellFormatting event handler

The code snippet below demonstrates how you can assign a tooltip to a cell in RadVirtualGrid.

WinForms RadVirtualGrid Setting tooltips in the CellFormatting event handler

C#
        
private void radVirtualGrid1Tooltips_CellFormatting(object sender, VirtualGridCellElementEventArgs e)
{
    if (e.CellElement.RowIndex >= 0)
    {
        e.CellElement.ToolTipText = e.CellElement.Value + "";
    }
}

The ToolTipTextNeeded event has higher priority and overrides the tooltips set in the CellFormatting event handler.

See Also

In this article
See Also
Not finding the help you need?
Contact Support