Need the total of the footer in gridview in a textbox outside the gridview
<p>I have a gridview with a footer and I display the total of the price column in the footer. I want to access the value in the footer and display it in the textbox which is outside the gridview.</p>

<p>This is how my gridview looks only the footer template</p>

<pre><code> &lt;asp:TemplateField HeaderText="Total" &gt;
&lt;ItemTemplate&gt;
&lt;asp:Label ID="lbltotal" runat="server" Text='' &gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;FooterTemplate&gt;
&lt;asp:Label ID="lbltotalprice" runat="server" Text=''&gt;&lt;/asp:Label&gt;
&lt;/FooterTemplate&gt;
&lt;/asp:TemplateField&gt;
</code></pre>

<p>Below is how i am displaying the total in the footer</p>

<pre><code>In gridview rowdatabound event
    if (e.Row.RowType == DataControlRowType.Footer)
            {
                Label amounttotal = (Label)e.Row.FindControl("lbltotalprice");
                amounttotal.Text = String.Format("{0:C2}", total);
            }  
</code></pre>

<p>I tried it in the below way in another method</p>

<pre><code>GridViewRow row = GridView1.FooterRow; 
Total.Text= ((Label)row.FindControl("lbltotalprice")).ToString();--- does not help at all
</code></pre>

<p>Please help in accessing this value in footer in a texbox outside of gridview.
Thanks in advance.</p>
