I'm trying to integrate the Ultimate ListBox for WPF with an Entity Framework query, with data virtualization enabled. As I understand it, this is not currently supported - I either have to use a ListDataSourceProvider, which loads the entire data set in memory, or I have to expose my data via a WCF data service and use a WcfDataServicesDataSourceProvider<T>.
I started writing a custom data source provider inheriting from SyncDataSourceProvider, which seemed to be the simplest option. When I used my provider, however, the ListBox called ExecuteCountQuery 199 times, and ExecuteDataQuery 176 times just to display the window. Each call to ExecuteDataQuery requested a single record.
I changed my custom provider to inherit from AsyncDataSourceProvider, using exactly the same code, and using the Task Parallel Library to execute the queries on a background thread. With the new provider, the ListBox calls BeginExecuteCountQuery once, and BeginExecuteDataQuery 9 times, with page sizes varying between 7 and 18 records, to display the window.
- Is there a bug with the SyncDataSourceProvider? I would expect it to request a whole page of data as required, not request every individual record separately, with several additional calls to ExecuteCountQuery in between. Since all the calls happen on the UI thread, it makes the application extremely sluggish.
- Are there any plans to add support for Entity Data Framework, and other IQueryable providers, in the future?
- Are there any plans to provider better documentation for creating custom data source providers?