Print RadToolTipManager content

4 posts, 0 answers
  1. Becky Bryda
    Becky Bryda avatar
    9 posts
    Member since:
    Sep 2006

    Posted 11 Jan 2011 Link to this post

    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.
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 11 Jan 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Becky Bryda
    Becky Bryda avatar
    9 posts
    Member since:
    Sep 2006

    Posted 11 Jan 2011 Link to this post

    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>
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 12 Jan 2011 Link to this post

    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.
Back to Top