Exemplo n.º 1
0
 private void NewCustBtn_Click(object sender, EventArgs e)
 {
     EditCustomerForm form = new EditCustomerForm();
     if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         List<Customer> cust = new List<Customer>(customerDataGridControl1.Customers);
         cust.Add(form.Customer);
         customerDataGridControl1.Customers = cust.ToArray();
     }
 }
Exemplo n.º 2
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if(e.ColumnIndex == EditCustomer.Index)
     {
         Customer c = (dataGridView1.Rows[e.RowIndex].Tag as Customer);
         EditCustomerForm form = new EditCustomerForm(c);
         if (form.ShowDialog() == DialogResult.OK)
             UpdateForm();
     }
 }