dparkes
asked on
Find ID of deleted row in GridView
This codes loops through all the ID's, except the one I wish to identify (the row on which I have selected "Delete"). I need to identify the ID of the row being deleted. If somone could point the way, I would be very much appreciative.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
string selectedID = "";
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button delete = (Button)e.Row.FindControl("delete");
selectedID = GridView1.DataKeys[e.Row.RowIndex].Value.ToString();
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.