How to Hide gridview Allow paging While taking print

Posted by rajrprk-12523 under ASP.NET on 11/10/2011 | Points: 10 | Views : 2312 | Status : [Member] | Replies : 2
I want to hide the allow paging while taking the print out. once the print is taken the the allow paging should view for navigating to the next page




Responses

Posted by: Vuyiswamb on: 11/10/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
When you want to Print you need to disable the Paging and rebind your grid again and then Print

Thank you for posting at Dotnetfunda
[Administrator]

rajrprk-12523, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: rajrprk-12523 on: 11/11/2011 [Member] Starter | Points: 25

Up
0
Down
i have tried that one, like this but not working

protected void btnPrint_Click(object sender, EventArgs e)
{
int count = GridView1.PageCount;
if (count == GridView1.PageIndex + 1)
{
GridView1.EmptyDataRowStyle.Font.Bold = true;
GridView1.FooterRow.Visible = true;
}
else
{
GridView1.FooterRow.Visible = false;
}
//GridView1.PagerSettings.Visible = false;
GridView1.AllowPaging = false;
//GridView1.BottomPagerRow.Visible = false;
GridView1.FooterRow.Font.Bold = true;
Response.Write("<script>window.print();</script>");
BindGrid();
GridView1.AllowPaging = true;
}
once finally i set as true, paging shown in the printing time also..
please post any help


rajrprk-12523, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response