New to Telerik UI for WinForms? Download free 30-day trial

ToolTips

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


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


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.