This is a migrated thread and some comments may be shown as answers.

Wrong tooltip on RADgrid hyperlink column

1 Answer 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neo
Top achievements
Rank 1
Neo asked on 08 Mar 2011, 05:59 PM
Hello All,

We are using RadGrid in one of the project. We have hyperlink column as part of the grid. Now what happens is we have implemented client side biding for the grid. right now when we bind it first time from server it shows currect tooltip for hyperlink column

but as soon as we retrieve data from web service and make client side binding it shows old values on the tooltip for new links.

So if first time data is, John and tool tip is John ,
we do the paging on client side and next data is carl and the tooltip still shows John. 

We have more then 15 hyperlink columns in different radgrid so we are using it widely in the project.
Let me know the quickest way to fix this or remove the tooltip from hyperlink column.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 11 Mar 2011, 11:03 AM
Hi Neo,

When using only client-side databinding the GridHyperLinkColumn does not set a tooltip for the links. Tooltip is set only when using server-side databinding. When you mix the two, the hyperlinks are rendered with a tooltip from the server. Because rebinding the grid on the client does not modify the tooltip, the latter remains the same after binding. This is why you are getting the tooltips rendered from the server on initial load. You can either remove the tooltip or better set the tooltip to the inner text of the hyperlink after binding. You can use RadGrid's client-side OnRowDataBound event for that:

<ClientEvents OnRowDataBound="gridRowDataBound" />

function gridRowDataBound(sender, args)
{
    var gridItem = args.get_item();
    var linkColumnName = "Link";
    var hyperlink = gridItem.get_cell(linkColumnName).getElementsByTagName("a")[0];
    if (hyperlink)
    {
        hyperlink.title = hyperlink.innerHTML;
    }
}

In the above example, "Link" is the UniqueName of my GridHyperLinkColumn.

Veli
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Neo
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or