New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Adding Tooltips for Grid Items

There are many cases when you want you grid to show a tooltip when an item is hovered with the mouse. Tooltips are understood by screen readers and can be used as an accessibility feature.

Add Tooltips on Server-Side

In brief you need to handle either ItemDataBound or ItemCreated Event. Usually, the tooltips are displayed for the header and the grid data cells

In the first case you show the tooltips only when GridHeaderItem is hovered. In this case you should check in the event handler if e.Item is GridHeaderItem.

The second scenario is when the tooltips will be shown for any grid item. In this case you should check if e.Item is GridDataItem.

Here is a full working sample:

ASP.NET
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="800px"
            OnNeedDataSource="RadGrid1_NeedDataSource"
            OnItemDataBound="RadGrid1_ItemDataBound">
            <MasterTableView DataKeyNames="ID">
            </MasterTableView>
        </telerik:RadGrid>

Add Tooltips on Client-Side

You can also ad Tooltips using JavaScript. And if you want to display the unique ID of the item, you can set the field name to the ClientDataKeyNames collection. More information you can find here:

This example is also fully isolated and you can simply copy-paste it to your web site.

ASP.NET
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="800px"
            OnNeedDataSource="RadGrid1_NeedDataSource">
            <ClientSettings>
                <%--This can be OnDataBound if you are using client-side binding--%>
                <ClientEvents OnGridCreated="gridCreated" />
            </ClientSettings>
            <MasterTableView DataKeyNames="ID" ClientDataKeyNames="ID">
            </MasterTableView>
        </telerik:RadGrid>

Add Professional Tooltips with Built-in Skins

Telerik UI for ASP.NET AJAX provides its own RadToolTip component which can be used to match the skin and theme of your app. In addition, it also provides rich functionality like dynamic AJAX loading depending on the targeted value and auto-tooltipify of an entire area.

You can check these implementation and use them in your own project: