You can use RowCommand event for deleting row from gridview
use as
<asp:LinkButton ID="l1" runat="server" Text="Remove" %>' CommandName="Remove" CommandArgument='<%#Eval("id") %>'></asp:LinkButton>
and on rowcommand event
void GVDetail_RowCommand_RowCommand(Object sender, GridViewCommandEventArgs e)
{
if(e.CommandName=="Remove")
{
GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
int index = row.RowIndex;
string id=row.Cells[0].Text;
GVDetail.DeleteRow(int.Parse(id));
GVDetail.DataBind();
}
}