private void toolBtnFindOrderNumber_Click(object sender, EventArgs e) { List <DeliveryPoint> orderList = new List <DeliveryPoint>(dpBindingSource.DataSource as BindingList <DeliveryPoint>); DeliveryPointFilter userFilter = new DeliveryPointFilter(Convert.ToInt32(toolTxtFindOrderNumber.Text)); //Predicate<DeliveryPoint> filterByOrderID = new Predicate<DeliveryPoint>(orderFilter.MatchesOrderID); Predicate <DeliveryPoint> filterByOrderID = new Predicate <DeliveryPoint>(userFilter.BeginsWithOrderID); DeliveryPoint deliverypoint = orderList.Find(filterByOrderID); if (deliverypoint == null) { MessageBox.Show("No matching DeliveryPoint found", "Not Found", MessageBoxButtons.OK); } else { int index = dpBindingSource.IndexOf(deliverypoint); dpBindingSource.Position = index; } }
public DeliveryPointsVM(DeliveryPointFilter filter) : this(filter.UoW) { Filter = filter; }