Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET AJAX > Grid > Printing grid headers on every page

Printing grid headers on every page

Feed from this thread
  • Posted on Feb 26, 2007 (permalink)

    Requirements

    RadGrid version

    RadGrid Q4 2007 or later

    .NET version

    2.0

    Visual Studio version

    2005

    programming language

    C#, CSS

    browser support

    all browsers supported by RadGrid



    PROJECT DESCRIPTION

    Printing a web page with a RadGrid control will usually make the grid span across several [paper] pages. Reading them might be hard and we may want to have the column headers available on each page. To achieve that we have to define a CSS setting that will be applied for the print media only. It will change the grid table's thead and tbody element display settings:

    <style type="text/css">  
    @media print  
    {  
        th   
        {  
            font-family:Arial;  
            color:black;  
            background-color:lightgrey;  
        }  
        thead   
        {  
            display:table-header-group;  
        }  
        tbody   
        {  
            display:table-row-group;  
        }  
    }  
    </style> 

    The attached files contain a project with a single page bound to the Northwind sample products and a PDF file containing the printed pages.
    Attached files

  • lyners avatar

    Posted on Mar 10, 2008 (permalink)

    Hi Hristo,
    I tried your CSS in my code, but my headers will not repeat on the next page. The only thing that happened, was that the Header stopped wrapping on the first page of print. The only difference is I am using VB, and you are using C#. Otherwise everthing else is the same.

    I downloaded your example and it does work.

    So I am confused why this is happening.

    Any ideas on where I could look to find some good CSS advise to possibly get this working?

  • Sebastian Sebastian admin's avatar

    Posted on Mar 11, 2008 (permalink)

    Hello lyners,

    If you applied the @media print style definition discussed in this entry the grid headers should be printed on every page regardless of the programming language you use. Can you please double-check that the style definitions are propagated as expected? You may also compare both versions of the project and outline the differences between them. This can identify the problem to address it accurately.

    To convert the C# code from the example, I suggest you use our free online converter:

    http://converter.telerik.com/
     
    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

Back to Top

Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET AJAX > Grid > Printing grid headers on every page