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

Print RadToolTipManager content

3 Answers 79 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Becky Bryda
Top achievements
Rank 1
Becky Bryda asked on 11 Jan 2011, 05:00 PM
I found a KB article on how to print the content of a RadToolTip (http://www.telerik.com/support/kb/aspnet-ajax/tooltip/print-radtooltip-content.aspx), but I can't get this sort of functionality to work with the RadToolTipManager.

I'm using the manager because I have a GridView that I've got a "details" column in - this shows a tooltip with a user control, i want to be able to print just the contents of the user control.  Please provide assistance in doing so.

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 11 Jan 2011, 05:02 PM
Hi Becky Bryda,

 You can find sample demo code on how to print only the content of the tooltip below:


http://www.telerik.com/support/kb/aspnet-ajax/tooltip/print-radtooltip-content.aspx

In case you face a problem or you have additional questions, do not hesitate to contact us again.

Regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Becky Bryda
Top achievements
Rank 1
answered on 11 Jan 2011, 05:12 PM
Yes, I have tried that demo, it is not working when I use the RadToolTipManager.
I get the following error:
 Parser Error Message: Type 'Telerik.Web.UI.RadToolTipManager' does not have a public property named 'Button'.

Here is a snippet of my code:
<script type="text/javascript">
  
    function PrintContent() {
        var tooltip = $find("<%=tip.ClientID %>");
        var content = tooltip.get_content();
        var pwin = window.open('', 'print_content', 'width=300,height=300');
        pwin.document.open();
        pwin.document.write('<html><body onload="window.print()">' + content + '</body></html>');
        pwin.document.close();
        setTimeout(function() { pwin.close(); }, 1000);
  
    
            
        </script
  
<asp:GridView ID="GridParent" runat="server" OnRowDataBound="GridParent_RowDataBound"
    CellPadding="4" ForeColor="#333333" DataKeyNames="Id">
        <Columns>
            <asp:TemplateField>
            <ItemTemplate>
                <div style="text-decoration: underline; cursor: pointer;">
                    <asp:Label Visible="true" ID="lnkSelect" runat="server" Text="Show Details"></asp:Label></div>
            </ItemTemplate>
        </asp:TemplateField>
   </Columns>
</asp:GridView>
  
  
 <telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="LeaveToolTip" HideDelay="1"
            Width="500" Height="350" runat="server" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element"  Position="MiddleRight">
<asp:Button ID="btn" runat="server" OnClientClick="PrintContent();return false;"
                Text="Print" /> 
  
</telerik:RadToolTipManager>
0
Svetlina Anati
Telerik team
answered on 12 Jan 2011, 10:08 AM
Hello Becky,

The error you receive does not come from the javascript used for printing but it is caused by the fact that a Button control is placed inside the markup declaration  of the tooltip manager - please put the button outside it. Note, also, that in the case of RadToolTipManager you should reference the currently active tooltip by using the Telerik.Web.UI.RadToolTip.getCurrent() syntax instead of using $find.

Best wishes,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ToolTip
Asked by
Becky Bryda
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Becky Bryda
Top achievements
Rank 1
Share this question
or