Monday, 15 July 2013

c# - Hiding two columns of GridView while printing it Asp.net -



c# - Hiding two columns of GridView while printing it Asp.net -

function printform() { var printcontent = document.getelementbyid("<%= printpanelid.clientid %>"); var windowurl = "about:blank"; var uniquename = new date(); var windowname = "print" + uniquename.gettime(); var printwindow = window.open(windowurl, windowname, "left=50000,top=50000,width=0,height=0"); printwindow.document.write(printcontent.innerhtml); printwindow.document.close(); printwindow.focus(); printwindow.print(); printwindow.close(); } function hidcolumn() { // col_num = document.getelementbyid("button").value; rows = document.getelementbyid("<%= gv1.clientid %>").rows; (i = 0; < rows.length; i++) { rows[i].cells[8].style.display = "none"; } (j = 0; j < rows.length; j++) { rows[j].cells[9].style.display = "none"; } } // alter logic suit taste function clicked() { var b = hidcolumn(); if (b) printform() homecoming b; } <asp:imagebutton id="imagebutton2" runat="server" imagealign="right" imageurl="images/printer.jpg" style="margin-left: 5px; margin-right: 15px" onclick="imagebutton2_click" width="36px" onclientclick="return clicked()" visible="false" />

however nil happening when click imagebutton

this line doesn't create sense: var b = hidcolumn();

the function hidcolumn doesn't homecoming anything.

c# asp.net gridview

No comments:

Post a Comment