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

Tooltips

Updated over 6 months ago

The tooltips are supported out of the box and you just need to enable them.

Enable tooltips

C#
radSparkline1.ShowToolTip = true;

The default tooltips will displayed when hovering over a particular data point.

WinForms RadSparkline Enable Tooltips

Customizing Tooltip Text

You can use the DataPointTooltipTextNeeded event to set custom tooltip text. The following snippet shows how you can access the event.

Subscribing to DataPointTooltipTextNeeded

C#
var toolTipControler = new SparkTooltipController();
toolTipControler.DataPointTooltipTextNeeded += ToolTipControler_DataPointTooltipTextNeeded;
radSparkline1.Controllers.Add(toolTipControler);

The following example shows how you can set the text in the event handler.

Customizing the Tooltip Text

C#
private void ToolTipControler_DataPointTooltipTextNeeded(object sender, Telerik.WinControls.UI.Sparkline.SparkDataPointTooltipTextNeededEventArgs e)
{
    var point = e.DataPoint as CategoricalSparkDataPoint;
    if (point.Value > 10)
    {
        e.Text = "Value Critical";
    }
    else
    {
        e.Text = "Normal Vlaue";
    }
}
In this article
Customizing Tooltip Text
Not finding the help you need?
Contact Support