private void but_AddStore_Click(object sender, EventArgs e) { DataGridViewRow selectedRow = null; editStoreForm = new EditStoreForm(selectedRow); editStoreForm.FormClosed += editStoreForm_FormClosed; editStoreForm.Show(); }
private void StoreCellDoubleClicked(object sender, DataGridViewCellEventArgs e) { if (dgv_Stores.SelectedCells.Count > 0) { int selectedrowindex = dgv_Stores.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = dgv_Stores.Rows[selectedrowindex]; editStoreForm = new EditStoreForm(selectedRow); editStoreForm.FormClosed += editStoreForm_FormClosed; if (Convert.ToString(selectedRow.Cells["Name"].Value) == " Double click to add store") { editStoreForm.but_StoreDelete.Visible = false; editStoreForm.but_StoreUpdate.Visible = false; } else { editStoreForm.but_StoreAdd.Visible = false; } editStoreForm.Show(); } }