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

Tooltip on mouseover of image

2 Answers 210 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 08 Jul 2011, 10:23 AM
I have a radgrid with a column called 'Note'. I want to display a small note icon if the column has data in it. Then when the user mouseovers the icon, it displays the contents from the 'Note' column.

Can this be done?

2 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 08 Jul 2011, 06:37 PM
Anyone? Can this be done. Any demos online?
0
Mira
Telerik team
answered on 13 Jul 2011, 02:36 PM
Hello Andrew,

In order to implement the desired functionality, I suggest that you use the approach from the Tooltipified RadGrid demo and add the images as target controls of the RadToolTipManager:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        Control target = e.Item.FindControl("targetControl");
        if (!Object.Equals(target, null))
        {
            if (!Object.Equals(this.RadToolTipManager1, null))
            {
                //Add the image (target) id to the tooltip manager
                this.RadToolTipManager1.TargetControls.Add(target.ClientID, (e.Item as GridDataItem).GetDataKeyValue("ProductID").ToString(), true);
 
            }
        }
    }
}

I hope this helps.

Regards,
Mira
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Mira
Telerik team
Share this question
or