In windows application I use the following javascript code to print a datagridview 'gvuserinfo'.
The form runs without error but I could not see the 'print' button. The same javascript code with web page works fine. How to solve this?
public MaterialsToBeReadyReport()
{
con.ConnectionString = Constring;
InitializeComponent();
webBrowser1.DocumentText =
@"<html><head>
<script type='text/javascript'>
function PrintGridData() {
var prtGrid = document.getElementById('<%=gvUserInfo.ClientID %>');
prtGrid.border = 0;
var prtwin = window.open('', 'PrintGridViewData', 'left=100,top=100,width=500,height=500,tollbar=0,scrollbars=1,status=0,resizable=1');
prtwin.document.write(prtGrid.outerHTML);
prtwin.document.close();
prtwin.focus();
prtwin.print();
prtwin.close();
}
</script>
</head><body></body></html>";
webBrowser1.Document.InvokeScript("PrintGridData");