Solved

Unhide Gridview row on print

Posted on 2008-10-20
2
348 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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