Print RadGrid contents

Thread is closed for posting
2 posts, 1 answers
  1. Answer
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 04 Aug 2009 Link to this post

    Requirements

    RadControls version RadControls for ASP.NET AJAX/ RadGrid for ASP.NET
    .NET version NET 2.0 and later
    Visual Studio version 2005, 2008 and later
    programming language C#/VB (no code-behind)
    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    This code-library demonstrates how to print the whole RadGrid/RadCalendar excluding the surrounding controls/elements. The output is generated in a new window (the resources are requested manually) and then printed via the standard window.print method.
    function PrintRadGrid()
    {
        var previewWnd = window.open('about:blank', '', '', false);
        var sh = '<%= ClientScript.GetWebResourceUrl(radGrid1.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",radGrid1.Skin)) %>';
        var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
        var htmlcontent = styleStr + "<body>" + $find('<%= radGrid1.ClientID %>').get_element().outerHTML + "</body></html>";
        previewWnd.document.open();
        previewWnd.document.write(htmlcontent);
        previewWnd.document.close();
        previewWnd.print();
        previewWnd.close();
    }

    UPDATE (2012/07/16):
    We have uploaded a modified version of the example that works properly with a separate Skins assembly. Please visit the following link for more information about the differences between the old approach and the new one.
  2. 55399722-08F4-4C16-B02F-AF2E96DF6AC2
    55399722-08F4-4C16-B02F-AF2E96DF6AC2 avatar
    4949 posts
    Member since:
    Jan 2017

    Posted 25 Mar 2010 Link to this post

    Hello,

    We just updated the code-library projects. Please submit a formal support ticket if you have any questions or suggestions about this code-library project.

    Best regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.