Printing grid headers on every page

Thread is closed for posting
3 posts, 0 answers
  1. A9E74E7C-52FA-4440-8D67-C26A0770B01B
    A9E74E7C-52FA-4440-8D67-C26A0770B01B avatar
    16 posts
    Member since:
    May 2004

    Posted 26 Feb 2007 Link to this post

    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.
  2. 5799C936-A589-4D0B-80F7-E420324390F1
    5799C936-A589-4D0B-80F7-E420324390F1 avatar
    23 posts
    Member since:
    Jun 2012

    Posted 10 Mar 2008 Link to this post

    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?

  3. C7498A83-7E2E-418C-8791-93EF573A7569
    C7498A83-7E2E-418C-8791-93EF573A7569 avatar
    9934 posts
    Member since:
    Nov 2016

    Posted 11 Mar 2008 Link to this post

    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

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