private void btnAggiungiDisco_Click(object sender, EventArgs e) { if (grdEventi.SelectedRows.Count == 1) { if (grdEventi.Columns.Contains("Numero") && grdEventi.SelectedRows[0].Cells["Numero"].Value != null) { long codEvento = long.Parse(grdEventi.SelectedRows[0].Cells["Numero"].Value.ToString()); AggiungiDiscoAEvento newForm = new AggiungiDiscoAEvento(codEvento); newForm.ShowDialog(); this.loadSubGrids(); } } }