private void RefreshNomCarriers() { List <CarrierWithDepot_View> PotentialDepots = PlannerClass.GetNomCarriers_withDepot(PassedInContract); List <CarrierWithDepot_View> OutDepots = new List <CarrierWithDepot_View>(); foreach (CarrierWithDepot_View x in PotentialDepots) { if (PassedInContract.Job_type == 0) { if (x.FTL_Availibility > 0) { OutDepots.Add(x); } } else { if (x.LTL_Availibility > 0) { OutDepots.Add(x); } } } NominatedCarrierDG.ItemsSource = OutDepots; }