title: Filling data in grid view using textbox on button click -it show an a error inder out of bound
body: <p>when i used a textbox to insert data it show index out of bound error</p>
  
  <pre><code>Button_Click()
  
      DataTable dt = new DataTable();
      DataRow dr;
      dt.Columns.Add("Name"); ///enter code here
      dt.Columns.Add("Address");
      dt.Columns.Add("Number");
      //First fill all the date present in the grid
      for (int intCnt = 0; intCnt &lt; grd.Rows.Count; intCnt ++)
      {
      if (grd.Rows[intCnt].RowType == DataControlRowType.DataRow)
      {
      dr = dt.NewRow();
      dr["Name"] = grd.Rows[intCnt].Cells[0].Value;/// at this point
      dr["Address"] = grd.Rows[intCnt].Cells[1].Value;
      dr["Number"] = grd.Rows[intCnt].Cells[2].Value;
      dt.Rows.Add(dr);
      }
      }
      dr = dt.NewRow();
      dr["Name"] = txt1.Text;
      dr["Address"] = txt2.Text;
      dr["Number"] = txt3.Text;
      dt.Rows.Add(dr);
      grd.DataSource = dt;
      grd.DataBind();
      }
  </code></pre>