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

RadToolTipManager & last page of RadGrid

1 Answer 141 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Thom Krystofiak
Top achievements
Rank 1
Thom Krystofiak asked on 15 Aug 2007, 09:40 PM
I have no idea where this problem lies but maybe someone else will. I have a RadToolTipManager and a RadGrid with a template column. In the radgrid's itemdataboud event I add a imagebutton from the template column thusly:

ToolTipManager.TargetControls.Add(e.Item.FindControl("btnWhatever").UniqueID);

This works great - except when the grid is paging, and I'm trying to load the last page. THEN i get

Cannot find a server control with ID=ctl00$PgContent$gridErrors$ctl01$ctl42$btnWhatever. If you need to specify a client-side element ID, please set IsClientID to true.


This is very confusing. Note the parent control of the button is ctl42. There IS no ctl42. The rows go up to 40 and that's the last button added. If I check the tool tip manager's TargetControls collection on prerender there is no ctl42-anything. So I don't know where it's getting the idea that I want it to do anything with ctl00$PgContent$gridErrors$ctl01$ctl42$btnWhatever. Where can I even begin looking to figure out why it's trying to do stuff with this non existent control?

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 20 Aug 2007, 07:54 AM
Hello Mark Cutter,
I already answered your support ticket, but I will place my answer here as well, so that it is available to all who might run into the same problem:

The RadToolTipManager works either with IDs or with ClientIDs, not with UniqueIDs. Therefore, just modify your code the following way and you should get the desired behavior:

protected void gridErrors_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridDataItem)  
        {  
            GridDataItem item = (GridDataItem)e.Item;  
            ToolTipManager1.TargetControls.Add(item.FindControl("btnJournals").ClientID, true);  
        }  
    } 


Greetings,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
Thom Krystofiak
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or