Solved

Unhide Gridview row on print

Posted on 2008-10-20
2
342 Views
Last Modified: 2013-12-17
Hi,
I have a Gridview on my aspx page. I repeat the header row after 8 rows and set Gridview RepeatedHeaderRow.Visible = false. I dont want to show the repeated header on the web page, but I want to show the repeated header row on print.

Thanks to the gurus in advance
0
Comment
Question by:nithin4
2 Comments
 
LVL 6

Expert Comment

by:M3mph15
ID: 22764897
Ok i haven't tested this but something like this should work:

    int hdrCount = GridView.Rows.Count() / 9;
    for (i = 1; i <= hdrCount; i++)
    {
        int z = i * 9;
        GridView.Rows(z).Visible = true;
     }
0
 

Accepted Solution

by:
nithin4 earned 0 total points
ID: 22766990
Hi M3mph15,
Thank you for your help. I tried what you suggested but it did not work.
I used the pre render event handler of Gridview and assigned an ID to the repeated header row and set visible = false. I added javascript to the page to get element by id of the repeated header and set the row.style.display = "block";
window.print()
row.style.display = none";
After the print options window comes up, the row is hidden on the page and the repeated header is not visible on the page.

Thank you,
Nithin
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question