private void textBox2_TextChanged(object sender, EventArgs e) { string value = textsearch.Text.ToLower(); var comptoirs = comptoirBLO.getby( x => x.Code .Contains(value) //|| // x..Contains(value) ); loadata(comptoirs); }
private void loadata() { string value = textsearch.Text.ToLower(); var comptoirs = venteBLO.getby ( x => x.Code.ToLower().Contains(value) || x.Designation.ToLower().Contains(value) ).OrderBy(x => x.Code).ToArray(); dataGridView1.DataSource = null; dataGridView1.DataSource = comptoirs; count.Text = $"{dataGridView1.RowCount}rows"; dataGridView1.ClearSelection(); }