How to fix this code for printing this GridView control?
<p>I am developing an intranet web application which works as a Suggestions Box. The Admin will see a list of all submitted suggestions in a GridView and he has the ability to accept or reject these suggestions. 
Under this GridView, there is another GridView that shows the suggestions with their status as Accepted or Rejected. The admin wants to print this second GridView. I followed <a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=92" rel="nofollow">this Tutorial</a> about printing any ASP.NET control and everything works well.</p>

<p>My ASP.NET Code:</p>

<pre><code>&lt;asp:Panel ID="Panel1" runat="server"&gt;
                        &lt;asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                      AllowSorting="True" CssClass="mGrid"
                                      AlternatingRowStyle-CssClass="alt" 
                                      RowStyle-HorizontalAlign="Center" 
                                      DataSourceID="SqlDataSource4"&gt;
                            &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt;
                            &lt;HeaderStyle Font-Bold = "true" ForeColor="Black" Height="20px"/&gt; 
                            &lt;Columns&gt;
                                &lt;asp:BoundField DataField="SubmittedMonth" HeaderText="Submitted Month" 
                                    SortExpression="SubmittedMonth" ReadOnly="True" /&gt;
                                &lt;asp:BoundField DataField="DivisionShortcut" HeaderText="Division" 
                                    SortExpression="DivisionShortcut" /&gt;
                                &lt;asp:BoundField DataField="Username" HeaderText="Username" 
                                    SortExpression="Username" /&gt;
                                &lt;asp:BoundField DataField="Name" HeaderText="Name" 
                                    SortExpression="Name" /&gt;
                                &lt;asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /&gt;
                                &lt;asp:BoundField DataField="Description" HeaderText="Description" 
                                    SortExpression="Description" /&gt;
                                &lt;asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" /&gt;
                                &lt;asp:BoundField DataField="Status" HeaderText="Status" 
                                    SortExpression="Status" /&gt;
                            &lt;/Columns&gt;
                                &lt;RowStyle HorizontalAlign="Center"&gt;&lt;/RowStyle&gt;
                        &lt;/asp:GridView&gt;
                        &lt;/asp:Panel&gt;
                        &lt;asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                            ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;" SelectCommand="SELECT     TOP (100) PERCENT LEFT(DATENAME(month, dbo.SafetySuggestionsLog.DateSubmitted), 3) + '-' + DATENAME(year, dbo.SafetySuggestionsLog.DateSubmitted) 
                      AS SubmittedMonth, dbo.Divisions.DivisionShortcut, dbo.SafetySuggestionsLog.Username, dbo.employee.Name, dbo.SafetySuggestionsLog.Title, 
                      dbo.SafetySuggestionsLog.Description, dbo.SafetySuggestionsType.Type, dbo.SafetySuggestionsStatus.Status
FROM         dbo.Divisions INNER JOIN
                      dbo.employee ON dbo.Divisions.SapCode = dbo.employee.DivisionCode INNER JOIN
                      dbo.SafetySuggestionsLog ON dbo.employee.Username = dbo.SafetySuggestionsLog.Username INNER JOIN
                      dbo.SafetySuggestionsType ON dbo.SafetySuggestionsLog.TypeID = dbo.SafetySuggestionsType.ID INNER JOIN
                      dbo.SafetySuggestionsStatus ON dbo.SafetySuggestionsLog.StatusID = dbo.SafetySuggestionsStatus.ID
WHERE     (DATEDIFF(month, dbo.SafetySuggestionsLog.DateSubmitted, GETDATE()) &amp;lt; 3)
ORDER BY dbo.SafetySuggestionsLog.DateSubmitted DESC"&gt;
                       &lt;/asp:SqlDataSource&gt;

                       &lt;asp:Button ID="btnPrint" runat="server" Text="Print" OnClick="btnPrint_Click" /&gt;
</code></pre>

<p>Code-Behind:</p>

<pre><code>protected void btnPrint_Click(object sender, EventArgs e)
    {
        Session["ctrl"] = Panel1;
        ClientScript.RegisterStartupScript(this.GetType(), "onclick", "&lt;script language=javascript&gt;window.open('Print.aspx','PrintMe','height=400px,width=800px,scrollbars=1');&lt;/script&gt;");
    }
</code></pre>

<p>I was able to print this table but when I put it inside UpdatePanel control I can't print it and I don't know why. <strong>Any Idea? Any help?</strong></p>

<pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt; 
    &lt;Triggers&gt;
        &lt;asp:AsyncPostBackTrigger ControlID="ddlDivision" EventName="SelectedIndexChanged" /&gt;
    &lt;/Triggers&gt;
    &lt;ContentTemplate&gt;
            &lt;br /&gt;
                Safety Suggestions List (for the last three months)

                        &lt;br /&gt;
                        &lt;asp:Panel ID="Panel1" runat="server"&gt;
                        &lt;asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                      AllowSorting="True" CssClass="mGrid"
                                      AlternatingRowStyle-CssClass="alt" 
                                      RowStyle-HorizontalAlign="Center" 
                                      DataSourceID="SqlDataSource4"&gt;
                            &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt;
                            &lt;HeaderStyle Font-Bold = "true" ForeColor="Black" Height="20px"/&gt; 
                            &lt;Columns&gt;
                                &lt;asp:BoundField DataField="SubmittedMonth" HeaderText="Submitted Month" 
                                    SortExpression="SubmittedMonth" ReadOnly="True" /&gt;
                                &lt;asp:BoundField DataField="DivisionShortcut" HeaderText="Division" 
                                    SortExpression="DivisionShortcut" /&gt;
                                &lt;asp:BoundField DataField="Username" HeaderText="Username" 
                                    SortExpression="Username" /&gt;
                                &lt;asp:BoundField DataField="Name" HeaderText="Name" 
                                    SortExpression="Name" /&gt;
                                &lt;asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /&gt;
                                &lt;asp:BoundField DataField="Description" HeaderText="Description" 
                                    SortExpression="Description" /&gt;
                                &lt;asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" /&gt;
                                &lt;asp:BoundField DataField="Status" HeaderText="Status" 
                                    SortExpression="Status" /&gt;
                            &lt;/Columns&gt;
                                &lt;RowStyle HorizontalAlign="Center"&gt;&lt;/RowStyle&gt;
                        &lt;/asp:GridView&gt;
                        &lt;/asp:Panel&gt;
                        &lt;asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                            ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;" SelectCommand="SELECT     TOP (100) PERCENT LEFT(DATENAME(month, dbo.SafetySuggestionsLog.DateSubmitted), 3) + '-' + DATENAME(year, dbo.SafetySuggestionsLog.DateSubmitted) 
                      AS SubmittedMonth, dbo.Divisions.DivisionShortcut, dbo.SafetySuggestionsLog.Username, dbo.employee.Name, dbo.SafetySuggestionsLog.Title, 
                      dbo.SafetySuggestionsLog.Description, dbo.SafetySuggestionsType.Type, dbo.SafetySuggestionsStatus.Status
FROM         dbo.Divisions INNER JOIN
                      dbo.employee ON dbo.Divisions.SapCode = dbo.employee.DivisionCode INNER JOIN
                      dbo.SafetySuggestionsLog ON dbo.employee.Username = dbo.SafetySuggestionsLog.Username INNER JOIN
                      dbo.SafetySuggestionsType ON dbo.SafetySuggestionsLog.TypeID = dbo.SafetySuggestionsType.ID INNER JOIN
                      dbo.SafetySuggestionsStatus ON dbo.SafetySuggestionsLog.StatusID = dbo.SafetySuggestionsStatus.ID
WHERE     (DATEDIFF(month, dbo.SafetySuggestionsLog.DateSubmitted, GETDATE()) &amp;lt; 3)
ORDER BY dbo.SafetySuggestionsLog.DateSubmitted DESC"&gt;
                       &lt;/asp:SqlDataSource&gt;

                       &lt;asp:Button ID="btnPrint" runat="server" Text="Print" OnClick="btnPrint_Click" /&gt;


       &lt;/ContentTemplate&gt;
    &lt;/asp:UpdatePanel&gt;
</code></pre>
