Input string was not in a correct format
<pre><code>    protected void CustomersGridView_DataBound(Object sender, EventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            decimal rowTotal = Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "DC_No_Decimal"));
            if (e.Row.DataItemIndex &gt;= inderGrid.PageIndex * inderGrid.PageSize &amp;&amp; e.Row.DataItemIndex &lt; inderGrid.PageIndex * inderGrid.PageSize + inderGrid.PageSize)
            {
                grdTotal = grdTotal + rowTotal;
            }
        }
        else if (e.Row.RowType == DataControlRowType.Footer &amp;&amp; inderGrid.PageCount == inderGrid.PageIndex + 1)
        {
            for (int i = 0; i &lt; inderGrid.Rows.Count; i++)
            {
                decimal currentRowCellVal = Convert.ToDecimal(inderGrid.Rows[i].Cells[3].Text);
                grdTotal += currentRowCellVal;
            }
            e.Row.Cells[3].Text = grdTotal.ToString("c");
        }
        else if (e.Row.RowType == DataControlRowType.Footer)
        {       
                e.Row.Cells[0].Text = "Totals:";
                // for the Footer, display the running totals
                e.Row.Cells[3].Text = grdTotal.ToString("0.00");
                // e.Row.Cells[2].Text = quantityTotal.ToString("d");        
                e.Row.Cells[1].HorizontalAlign = e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Right;
                e.Row.Font.Bold = true;
        }
   }
</code></pre>

<p>The purpose of this grid is to display total in the final page of the grid. When I'm going to the page page I get an error:</p>

<blockquote>
  <p>Input string was not in a correct format.</p>
</blockquote>

<p>In the final page of the grid I need total of all pages in the grid of cell[3]</p>
