RadToolTipManager & last page of RadGrid

2 posts, 0 answers
  1. Thom Krystofiak
    Thom Krystofiak avatar
    7 posts
    Member since:
    Oct 2006

    Posted 15 Aug 2007 Link to this post

    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:


    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?
  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 20 Aug 2007 Link to this post

    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);  

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top