Get the total of complete column of gridview in asp.net
<p>I am Using asp.net grid view and i have one column in that namely Calories and i want to show whole caloreis total at the top. i used the following code:</p>

<pre><code>            int count = grdViewSample.Rows.Count;
            double totCalories = 0;
            Label lblCalories = new Label();


            foreach (GridViewRow row in grdViewSample.Rows)
            {
                lblCalories = (Label)row.FindControl("lblCalories");
                totCalories = totCalories + Convert.ToDouble(lblCalories.Text);

            }
            lblTotalCaloreis.Text = lblTotalCaloreis.Text + " " + totCalories;
</code></pre>

<p>and my problem is that the calories total get changed by paging and i want total caloreies available in grid view.
Thanks</p>
