Exemplo n.º 1
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            Customer cust = new Customer();
            cust.FirstName = "First";
            cust.LastName = "Last";
            cust.Address = "Addr";

            customerList.Add(cust);
        }
Exemplo n.º 2
0
        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"));
        }