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

RadToolTipManager and radGrid

2 Answers 168 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 01 Aug 2008, 03:22 PM
Hi,
I have this almost working perfect.

I have a grid with a GridButtonColumn.
When the user hovers over this GridButtonColumn the tooltip popups up with LoadOnDemand information taken from a ProductID field in the grid.
This is all great... however !

The grid is pager style and when i select page 2 and hover over the 1st row.. it shows the information for the 1st row in page 1 ????

My code for adding controlID to the RadToolTipManager is below...
(Cell 4 is the column i hover over)

Any ideas please ?
Thanks
Mark

Protected

Sub grdProduct_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdProduct.ItemDataBound

If TypeOf e.Item Is GridDataItem Then

Dim item As GridDataItem = e.Item

RadToolTipManager1.TargetControls.Add(e.Item.Cells(4).ClientID, item.GetDataKeyValue(

"ProductID").ToString, True)

End If

End

Sub

2 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 04 Aug 2008, 09:56 AM
Hi Mark,

When you change the RadGrid's page, you actually display new records which have different target control ID. In order to achieve the desired behavior, you should update the RadToolTipManager's TargetControls collection. I assume that in your case the RadToolTipManager stays with the old values when the page is changed.

One possible solution is to clear the TargetControls collection in the RadGrid's PageIndexChanged event handler by adding the following code:

  protected void RadGrid1_PageIndexChanged(object source, GridPageChangedEventArgs e)  
    {  
        RadToolTipManager1.TargetControls.Clear();  
    } 

In case this does not help, please prepare a sample, fully runnable reproduction project (including DB, if needed), open a new support ticket and send it to me. Once I receive it, I will modify it in order to meet your requirements.



All the best,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark
Top achievements
Rank 1
answered on 05 Aug 2008, 09:02 AM
Woohoo !!!
That works great !

Many Thanks
Mark :-)
Tags
ToolTip
Asked by
Mark
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Mark
Top achievements
Rank 1
Share this question
or