private void nametb_TextChanged(object sender, EventArgs e) { if (nametb.Text != "") { dataGridView1.DataSource = lc.getCustomerByCustomerName(nametb.Text); dataGridView1.Columns[0].Width = 30; dataGridView1.Columns[1].Width = 60; dataGridView1.Columns[2].Width = 140; dataGridView1.Columns[3].Width = 160; dataGridView1.Columns[6].Width = 80; dataGridView1.Columns[7].Width = 80; dataGridView1.Columns[8].Width = 50; } }