Printing DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
Hi,

no directly, remember that the datagrid is a server side control, no it
does not exist in the client.
There are some workaround though, I had a similar situation, what I did was
this:
1- Wrapped the datagrid in a <div> like this:
<div ID="TheGridDiv" Name="TheGridDiv">

2- the Print button open a new empty page with this code:
<script>
function DoMe()
{
document.all["TheDiv"].InnerHTML =
opener.document.all["TheGridDiv"].InnerHTML;
print();
close();
}
</script>
<body onLoad ="DoMe();">
<div name="TheDiv">


PLEASE note that I wrote the above code in the email, it may contains error
but the idea is there.

cheers,
 
Back
Top