Link to home
Start Free TrialLog in
Avatar of dparkes
dparkesFlag for United States of America

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();
        } 
    }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of dparkes
dparkes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial