private async void PartIdTextChanged(object sender, EventArgs e) { if (cboxShowFinder.Checked) { TextBox tb = (TextBox)sender; if (!string.IsNullOrEmpty(tb.Text)) { if (dgvItems.Columns[dgvItems.CurrentCell.ColumnIndex].Name == "PartId") { if (tb.Text.Length > 1) { if (await Finder.Find(tb.Text)) { List <string> columns = new List <string>() { "PartId", "Name", "ProducerName", "Symbol", "SupplierName", "CreatedOn" }; Finder.AdjustColumns(columns); await Finder.Show(CurrentRowPoint); } else { Finder.Hide(); } } } } } }
private async Task SetPartFinder() { Finder = new PartFinder(dgvItems); List <string> columns = new List <string>() { "PartId", "Name", "ProducerName", "Symbol", "SupplierName", "CreatedOn" }; Finder.AdjustColumns(columns); this.Controls.Add(Finder); }