Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unhide Gridview row on print

Posted on 2008-10-20
2
Medium Priority
?
357 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

773 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