I have write this code
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
string rowindex = Convert.ToString(GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text); //there i find that GridView1.SelectedIndex value always -1
//string s = Convert.ToString(GridView1.Rows[e.RowIndex].Cells[1].Text); //i try this but when i try to write rowindex then it not appear.
Response.Write("");
ModalPopupExtender1.Show();
}
So how excess index?
Loading

Posted Oct 16, 2010, 1:11 AM
string rowindex = Convert.ToString(GridView1.Rows[e.NewEditIndex].Cells[1].Text);
Here you are not selected any row, so you will get SelectedRowIndex will be -1;
Use e.NewEditIndex this will return index in which row you are currenlty editing....
Hope this helps you.