private void tsmAdd_Click(object sender, EventArgs e) { AddOrChange rec = new AddOrChange(); if (rec.ShowDialog() == DialogResult.OK) { drivers.Add(rec.Own); } dgMain.DataSource = drivers.GetList(); }
private void tsmEdit_Click(object sender, EventArgs e) { int ind = dgMain.CurrentRow.Index; AddOrChange rec = new AddOrChange(drivers.Ind(ind));//передать выбранную строку if (rec.ShowDialog() == DialogResult.OK) { drivers.Edit(ind, rec.Own); dgMain.DataSource = drivers.GetList(); } }