private void создатьToolStripMenuItem_Click(object sender, EventArgs e) { NewPostForm form = new NewPostForm(); if (form.ShowDialog() == DialogResult.OK) { UpdateGrid(); } }
private void редактироватьToolStripMenuItem_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { Post post = dataGridView1.SelectedRows[0].DataBoundItem as Post; NewPostForm form = new NewPostForm(post); if (form.ShowDialog() == DialogResult.OK) { UpdateGrid(); } } }