hi,
I had a similar problem so what I did was open a new window, copy the grid
content to it and just call window.Print(), here is the code:
//for the printing page:
<script>
function FillPage()
{
var div = document.all["CONTENT"];
var origdiv = window.opener.document.all["TextPanel"];
div.innerHTML = origdiv.innerHTML;
print();
//close();
}
</script>
</head>
<body MS_POSITIONING="GridLayout" onload="FillPage();">
<span id="CONTENT">
</span>
in the parent page just enclose the grid in a div named "TextPanel"
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Newbie" <Ne****@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
i have a c# asp.net webform that contains a datagrid. the datagrid has a
vertical scroll. i need to give the user the ability to print the
datagrid's
entire content (all the rows). IE's print menu prints only the rows that
are
currently shown. thanks in advance.
string sqlcmd = sqlSelect + sqlOrder;
DataSet ds = new DataSet();
OracleConnection oraConn = new OracleConnection(connStr);
OracleCommand oraCMD = new OracleCommand(sqlcmd, oraConn);
oraConn.Open();
OracleDataAdapter da = new OracleDataAdapter(oraCMD);
da.Fill(ds);
dgSearchResults.DataSource = ds.Tables[0];
dgSearchResults.DataBind();
dgSearchResults.Visible = true;
where dgSearchResults is the Datagrid