I'm trying to print a particular DIV. there are few lines of header, and there is a gridview with some css applied. after a long search, I found a way to print the div to a different page, in order to not loose the focus on the main page. the problem is that the gridview is printed without any border, and it's useless in that way. I guess the problem is the CSS that I used for the gridview, but I don't know how to solve this.
this is the div
<div id="tabella">
<asp:label font-bold="true" Font-Italic ="true" ID="lbIdStabile" Text="Cod. Stabile: " runat="server">
<asp:label Text='<%# Bind("Id")%>' ID ="lbIdStb" runat="server"/></asp:label>
<br />
<asp:label ID="TextBox1" font-bold="true" Text='<%# Bind("indstab")%>' runat="server"/>
<br /> <br />
<asp:GridView ID="GrigliaPdr" CssClass="gridtext align-left table table-bordered" runat="server" RowStyle-Wrap="false" AutoGenerateColumns="False" CellPadding="0" DataKeyNames="Id" DataSourceID="SqlPDR" GridLines="None" AllowPaging="false" AllowSorting="false" AlternatingRowStyle-CssClass="gridAlternate" SelectedRowStyle-CssClass="gridSelect" showheader ="true">
<Columns>
<asp:BoundField DataField="Id" Visible="False"/>
<asp:BoundField DataField="piano" HeaderText="Piano" />
</Columns>
</asp:GridView>
<br />
<asp:Label ID="Label1" runat="server" Text='<%# Eval("data_odierna", "{0:dd/MM/yyyy HH:mm}") %>'>
</asp:Label>
</div>
this is my print function
function printDiv(divName) {
var prtContent = document.getElementById(divName);
var WinPrint = window.open('');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
and this is the button that calls the print function
<asp:Button ID="BT_PrintPDR" runat="server" class="win-command" title="Stampa PDR" cssclass="icon-search" Text="Stampa PDR" type ="button" OnClientClick="printDiv('tabella');" > </asp:Button>
any help would be really appreciated