private void CustomerForm_Load(object sender, EventArgs e) { dgvCustomer.DataSource = _customerRepository.SelectAllCustomers(); dgvCustomer.Refresh(); for (var i = 8; i < 12; i++) { dgvCustomer.Columns[i].Visible = false; } }
private void btShowAllCustomers_Click(object sender, EventArgs e) { var customerRepository = new SqlCustomerRepository(Globals.connectionString); var customerList = customerRepository.SelectAllCustomers(); dgvCustomers.DataSource = customerList; }