Solved

Unhide Gridview row on print

Posted on 2008-10-20
2
334 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now