title: Error: Specified argument was out of the range of valid values. in RowDataBound Gridview
body: <p>I want Bind data gridview and change data '0' to '-' . 
  but error: <strong>Specified argument was out of the range of valid values. Parameter name: index</strong></p>
  
  <p><strong>Code asp</strong></p>
  
  <pre><code> &lt;asp:GridView ID="GridView1" runat="server" 
    AutoGenerateColumns="False" AllowPaging="true" 
    OnRowCreated="GridView1_RowCreated"  
    OnRowDataBound="GridView1_RowDataBound" &gt;
     &lt;Columns&gt;
       &lt;asp:BoundField DataField="amt" HeaderText="Total" 
            DataFormatString="{0:#,##0.00000}" ItemStyle-HorizontalAlign="Right" /&gt;
     &lt;/Columns&gt;               
   &lt;/asp:GridView&gt;
  </code></pre>
  
  <p><strong>Code C#</strong></p>
  
  <pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {                
               string sAmt = DataBinder.Eval(e.Row.DataItem, "amt").ToString();    
  
            if (sAmt == "0.00000")
            {
               e.Row.Cells[10].Text = "-"; &lt;&lt;&lt; Line Error
            }
       }
   }
  </code></pre>
  
  <p>If fields AMT Show 0.</p>
  
  <p>I want instead "0" to "-" .</p>
  
  <p>Help me please. Thanks advance for time. ;)</p>