title: How to extract rows from gridview in asp.net c#
body: <p>I have created datatable kept in session &amp; assigned to gridview.I have to extract those records ,for that i have written code as follows but its giving value as null :</p>
  
  <pre><code>//To find gridview in Formview1
      GridView GridView1 = (GridView)Formview1.FindControl("GridView1");
      GridView1.DataSource = (DataTable)Session["tabdetails"];
      GridView1.DataBind();
  
      string str, str1, str2, str3, str4, str5, str6;
      for (int i = 0; i &lt; GridView1.Rows.Count; i++)
      {
          str = GridView1.Rows[i].Cells[0].Text;
          str1 = GridView1.Rows[i].Cells[1].Text;
          str3 = GridView1.Rows[i].Cells[2].Text;
          str4 = GridView1.Rows[i].Cells[3].Text;
          str5 = GridView1.Rows[i].Cells[4].Text;
      }
  </code></pre>
  
  <p>Please suggest me to do right changes?
  Thank you.
  Asp.net c#</p>