why index out of range exception?
<p>I am using this code to get the index of <code>last row</code> in gridview and then putting empty string in particular cell but throws error: <code>Index out of range</code></p>

<pre><code>protected void grdViewAdvances_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow) 
    {
        int RowIndex = grdViewAdvances.Rows.Count-1 ;

        grdViewAdvances.Rows[RowIndex].Cells[5].Text = "";
    }
</code></pre>