title: i want to get the value of selected index in gridview in asp.net
body: <p>i want to get the value of selected  index in gridview in but i am not get the value please tell how  i am not know in which event of grid i get the value
  i use this code on onselectedindexchange event of grid and on rowediting</p>
  
  <p>but how i get the value i am not know </p>
  
  <p>Code is</p>
  
  <pre><code>protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
  {
      string name = GridView1.SelectedRow.Cells[0].Text;   
  }
  
  protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
  {
      string s = GridView1.Rows[e.NewEditIndex].Cells[6].Text;
  }
  </code></pre>