private void btAdd_Click(object sender, EventArgs e) { Customer cust = new Customer(); cust.FirstName = "First"; cust.LastName = "Last"; cust.Address = "Addr"; customerList.Add(cust); }
private void Form1_Load(object sender, EventArgs e) { Customer cust = new Customer(); cust.FirstName = "First"; cust.LastName = "Last"; cust.Address = "Addr"; customerList.Add(cust); customerList.AllowNew = true; customerList.AllowRemove = true; customerList.AllowEdit = true; customerDataGridView.DataSource = customerList; tbFirstName.DataBindings.Add(new Binding("Text",customerList,"FirstName")); }