private void editBtn_Click(object sender, EventArgs e) { if (this.stationsGrid.SelectedRows.Count > 0) { var stationId = (int)this.stationsGrid.SelectedRows[0].Cells["ID"].Value; var editStationForm = new EditStationForm(this, stationId); editStationForm.ShowDialog(this); } }
private void addBtn_Click(object sender, EventArgs e) { var editStationForm = new EditStationForm(this); editStationForm.ShowDialog(this); }