Call your
fill_Grid()
method after executing delete to reflect the changes you've made in your GridView.
protected void grd_RowCommand(object sender, GridViewCommandEventArgs e){
if (e.CommandName == "DEL")
{
con.Open();
LinkButton lnkbtn = sender as LinkButton;
GridViewRow grdRow = lnkbtn.NamingContainer as GridViewRow;
string EmpId = grd.DataKeys[grdRow.RowIndex].Value.ToString();
cmd = new SqlCommand("sp_Emp_Delete",con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Id", EmpId);
cmd.ExecuteNonQuery();
con.Close();
fill_Grid();
}
}
I would also suggest you to debug your code. Set a break point at RowCommand event, then step into your codes to figure out what's happening.