For the benefit of anyone who come across this thread. I have been running into the issue of the ItemsLoading Event being called twice for the topmost items. Originally my code would call to the server twice via a web service to get the items requested. The SQL that I was running on the server was placing a high load on it and making two requests at the same time doubled the run time of the SQL (e.g. 12 seconds instead of 6 seconds).
To fix this the ItemsLoading Event is received twice. One call is made to the server and when complete, VirtualDataSource.Load is called twice. If VirtualDataSource.Load is not called twice sometimes the scroll bar would not represent the true size of the available items.
The detection of the double load is done by one list tracking what is being loaded. When the ItemsLoading Event fires the second time, A check is done to see if the request is on the first tracking list. If it is on that list, the request is added to another tracking list indicating that it is a double load and the server is not called. In the call back from the server, VirtualDataSource.Load is called once and t request removed from the first tracking list. Then a check is done to see if the request is on the second tracking list indicating a double load. If present there VirtualDataSource.Load is called again.
Tim