private void ShowButtons() { // Hide all buttons (except edit and delete) Ok_button.Hide(); Cancel_button.Hide(); Add_Tenant_button.Hide(); Add_SP_button.Hide(); Edit_button.Show(); Delete_button.Show(); if (edit || AddSP || AddTenant) { Ok_button.Show(); Cancel_button.Show(); Edit_button.Hide(); Delete_button.Hide(); } }
private void Update_DGV_CellClick(object sender, DataGridViewCellEventArgs e) { int row = e.RowIndex; if (row >= 0) { RowToEdit = row; Update_button.Show(); Add_button.Show(); Delete_button.Show(); } else { RowToEdit = new int(); Add_button.Hide(); Update_button.Hide(); Delete_button.Hide(); } }