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

RadToolTip on HTML button click

1 Answer 161 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Ranjan
Top achievements
Rank 1
Ranjan asked on 06 Oct 2011, 12:19 PM
Hi,
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>
   </div>
</telerik:RadToolTip> 
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...

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Oct 2011, 03:25 PM
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,
Marin
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
Tags
ToolTip
Asked by
Ranjan
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or