RadToolTip on HTML button click

2 posts, 0 answers
  1. Ranjan
    Ranjan avatar
    38 posts
    Member since:
    Sep 2011

    Posted 06 Oct 2011 Link to this post

    I have a repeter control which have HTML button. On click of that button I am showing RadToolTip.Code is :

        <telerik:RadToolTip ManualClose="true" ShowEvent="FromCode" ID="RadToolTip2" Skin="Vista" RelativeTo="Mouse"   
        runat="server" TargetControlID="btnTooltipView" IsClientID="true">   
        <div style="margin:5px 5px 0px 5pxfont-size:12pxpadding-bottom10px;">
        <div style="border-bottom:solid 1px #ccc;margin-bottom:9px;font-size:11px;">First Name: Elizabeth <br /> Last Name: Jones <br /></div>
        Notes:<br />
         <asp:Label runat="server" ID="StartingOn" Text="Another general note added to appointment."></asp:Label>
    Here btnTooltipView is id of button in repeter template. My problem is that on browser there is many buttons with 
    same name appears.so when i click on any button tooltip appears always on first button,because it pick first button id as target. Please help me...
  2. Marin Bratanov
    Marin Bratanov avatar
    3899 posts

    Posted 07 Oct 2011 Link to this post

    Hi Ranjan,

    Please examine the following online demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultcs.aspx. More specifically - the right-hand side GridView. In it there is a RadToolTip for every row and its TargetControlID property is set to the server ID of the label (in your case this will be the server ID of the button). The important bit is that the IsClientID is not set and it defaults to false, so that the tooltip looks for the server control. You can also set the ShowEvent to OnClick and the tooltip will automatically attach an event handler to its target element, which would save some manual JavaScript.

    Of course, another option is to use the RadToolTipManager if you do not wish to create multiple instances of the RadToolTip, but then you would need to configure its OnAjaxUpdate event to load the content dynamically.

    Best wishes,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top