a metà di VerificaStatoClient

int idSede = Convert.ToInt32(dgvElencoClient.Rows[i].Cells["IdSede"].Value);

c'è il commento a fondo riga.