private void newRowToolStripMenuItem_Click(object sender, EventArgs e) { if (DatabaseFunct.selectedTable != "") { if (Program.mainForm.TableMainGridView.Columns.Count > 0) { DatabaseFunct.AddRow(Program.mainForm.TableMainGridView, false, 0); } else { System.Windows.Forms.MessageBox.Show("add a column first"); } } else { System.Windows.Forms.MessageBox.Show("no table selected"); } }
public void subTableNewRowButton_Click(object sender, EventArgs e) { Button senderButton = sender as Button; DataGridView senderDGV = senderButton.Parent as DataGridView; if (DatabaseFunct.selectedTable != "") { if (senderDGV.Columns.Count > 0) { DatabaseFunct.AddRow(senderDGV, false, 0); } else { System.Windows.Forms.MessageBox.Show("add a column first"); } } else { System.Windows.Forms.MessageBox.Show("no table selected"); } }
private static void insertRow(object sender, System.EventArgs e) { DatabaseFunct.AddRow(DGV, true, rowIndex); Program.mainForm.RecenterSubTables(); cMenu.Dispose(); }