private void AddAward() { var form = new AwardForm(); if (form.ShowDialog() == DialogResult.OK) { listOfAwards.Add(new Award(_awardId++, form.AwardName, form.AwardDesc)); ctrGridAward.DataSource = null; ctrGridAward.DataSource = listOfAwards; } }
private void EditAward() { Award award = (Award)ctrGridAward.SelectedCells[0].OwningRow.DataBoundItem; var form = new AwardForm(award); if (form.ShowDialog() == DialogResult.OK) { award.AwardName = form.AwardName; award.AwardDescription = form.AwardDesc; DisplayAwards(); } }