I'm trying to create a generic combo box to select one of out business objects. I will try to show ou the scope:
Control (lets call it like this) GenericCombobox<Person>:
- Automatically loads items source from db when loaded (this is done asynchronously)
- the itemsssource is VirtualQueryableCollectionView created upon Telerik's Data Access query similar to db.GetAll<People>();
- Has one consistent template
- Allows to bind to SelectedItem
The intention is to create one consistent Selector for most of our BO - like Person, Customer, Order, Country just by creating inherited controls like CustomerCombobox : GenericCombobox<Customer> and putting in in xaml without having to manage itemssources.
I have few problems - combobox is loading all items from VirtualQueryableCollectionView - for our orders collection this is over 150k items. And since we will have for example 5 comboboxes on one view memory usage of application is running very very high.
Is there any way, to dynamically load items source - for example only show first 100 results matching search text? I tried to do something similar but I run into issues, because in most cases our currently selected item is not in these 100 first results. And when selected item is not in itemssource - we're losing selection.