المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to load large data to multiple filtered combobox's



C# Programming
12-08-2009, 08:50 AM
Hi,

I'm after some suggestions on best practice to resolve an issue of loading large data combobox's (WPF).
I have two combo's Country & Airport. Country combo is to filter Airport combo (with just Airports in that Country) simple...

There are approx 260 Countries and 10,000+ airports worldwide

Using MVVM public viewmodelFlights()
{
CountryList = new List(wcfService.GetCountries());
AirportList = new List(wcfService.GetAirports());

icCountryView = CollectionViewSource.GetDefaultView(CountryList );
icCountryView.CurrentChanged += new EventHandler(icCountryView_CurrentChanged);
icCountryView.MoveCurrentToPosition(-1);

icAirportView = CollectionViewSource.GetDefaultView(AirportList );
icAirportView.CurrentChanged += new EventHandler(icAirportView_CurrentChanged);
icAirportView.MoveCurrentToPosition(-1);
} just so you get the vm idea http://www.barakasoft.com/script/Forums/Images/smiley_biggrin.gif

I'm trying to get this initial loading quicker. Is there anyway to only load the airports once the Country has been selected?
I have a bigger problem with a hospital list which has 1,000,000+ records!!