private void tsmiEdit_Click(object sender, System.EventArgs e) { //CheckedMenuItem = (ToolStripMenuItem)sender; DataTable dataTable = (DataTable)dataGridView.DataSource; editForm = new EditForm("Edit entry", dgvp.SelectedDataRow, dataGridView.Columns, conn); //editForm.UpdateEntry += new EditForm.Event(dataGridView_CurrentCellChanged); editForm.ShowDialog(); adapter.Update(editForm.dataTable); //dgvp.Reset(adapter); editForm = null; }
private void tsmiAdd_Click(object sender, System.EventArgs e) { //CheckedMenuItem = (ToolStripMenuItem)sender; editForm = new EditForm("Add entry", dgvp.DataTable.NewRow(), dataGridView.Columns, conn); editForm.ShowDialog(); adapter.Update(editForm.dataTable); conn.Open(); DBCacheStock(); conn.Close(); dgvp.Reset(adapter); editForm = null; }