private void btnModSociete_Click(object sender, EventArgs e) { FormModificationSociete form = new FormModificationSociete(); if (this.dataGridSocietes.SelectedRows.Count > 0) { int selectedRowIndex = this.dataGridSocietes.SelectedRows[0].Index; int IdSociete = Convert.ToInt32(this.dataGridSocietes.Rows[selectedRowIndex].Cells["IdSociete"].Value); string NomSociete = this.dataGridSocietes.Rows[selectedRowIndex].Cells["NomSociete"].Value.ToString(); string DescriptionSociete = this.dataGridSocietes.Rows[selectedRowIndex].Cells["DescriptionSociete"].Value.ToString(); string NumeroSiret = this.dataGridSocietes.Rows[selectedRowIndex].Cells["NumeroSiret"].Value.ToString(); form.LoadInfo(IdSociete, NomSociete, DescriptionSociete, NumeroSiret); } this.Hide(); form.Show(); }