private void txtPartSearch_TextChanged(object sender, EventArgs e) { TextBox tb = (TextBox)sender; searchTerm = tb.Text; if (tb.Text.Length > 0) { dgPartsList.DataSource = partsService.SearchParts(searchTerm, searchOption); } }
private void textBox2_TextChanged(object sender, EventArgs e) { TextBox tb = (TextBox)sender; listBox1.DisplayMember = "ItemDescription"; this.listBox1.DataSource = _partService.SearchParts(tb.Text, SearchOptions.Contains); }