private void button2_Click(object sender, EventArgs e)
 {
     EditDataForm addForm = new EditDataForm();
     addForm.ShowDialog();
     object[] obj = addForm.CreateRowData();
     if (obj != null)
     {
         ((DataTable)dataGrid1.DataSource).Rows.Add(obj);
     }
 }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            EditDataForm addForm = new EditDataForm();

            addForm.ShowDialog();
            object[] obj = addForm.CreateRowData();
            if (obj != null)
            {
                ((DataTable)dataGrid1.DataSource).Rows.Add(obj);
            }
        }
 private void button3_Click(object sender, EventArgs e)
 {
     int i = dataGrid1.CurrentRowIndex;
     if (dataGrid1.DataSource != null && i >= 0)
     {
         EditDataForm addForm = new EditDataForm(((DataTable)dataGrid1.DataSource).Rows[i]);
         addForm.ShowDialog();
         object[] obj = addForm.CreateRowData();
         if (obj != null)
         {
             ((DataTable)dataGrid1.DataSource).Rows[i].ItemArray = obj;
         }
     }
 }
Example #4
0
        private void button3_Click(object sender, EventArgs e)
        {
            int i = dataGrid1.CurrentRowIndex;

            if (dataGrid1.DataSource != null && i >= 0)
            {
                EditDataForm addForm = new EditDataForm(((DataTable)dataGrid1.DataSource).Rows[i]);
                addForm.ShowDialog();
                object[] obj = addForm.CreateRowData();
                if (obj != null)
                {
                    ((DataTable)dataGrid1.DataSource).Rows[i].ItemArray = obj;
                }
            }
        }