You are always updating the 0th row hence it is not updating. instead of 0 use row.RowIndex
try the following
DataSet DSContact = DMLObj.Load_DataSet("Usp_LoadData", "ContactPerson", idf);
foreach (GridViewRow row in GVContactPerson.Rows)
{
((TextBox)row.FindControl("txtContactName")).Text=DSContact.Tables[0].Rows[0]["ContactName"].ToString();
((TextBox)row.FindControl("txtemail")).Text = DSContact.Tables[0].Rows[row.RowIndex]["ContactEmailID"].ToString();
((TextBox)row.FindControl("txtmob1")).Text = DSContact.Tables[0].Rows[row.RowIndex]["ContactMobile"].ToString();
Session["contact"] = ((TextBox)row.FindControl("txtContactName")).Text;
string pid = Convert.ToString(DMLObj.getid("Select ContactPersonID from tbl_ContactPersonDetails where ContactName='" + Session["contact"].ToString() + "'"));
Session["contactID"] = pid;
}