Hello,
I'm working on an infinite scroll dropdown, and having some issues with trying to figure out to do a bulk update of the underlying list.
We decided to go with a BindingList, so that we could set the data source once, and as the user scrolls update what's in the list (rather than re-applying the DataSource) so the scroll position would be kept.
My problem is with performance.
If there are 5,000 total records in my dropdown, and I want to show about 1,000 at a time, I add or remove items (the same static placeholder to start) until my BindingList has 5,000 records in it. Then, depending on where the offset is, I update those 1,000 records to the proper "page" from the server.
With that data size, the first time I update my list, there are 6,000 updates sent to the UltraCombo, and it just locks up. Subsequent updates are still 1,000 (or more if the total size changes).
Is there a way to properly bulk update a BindingList that'll play nice with an UltraCombo?
I've tried:
I've also tried a handful of the various refresh/invalidate/pairing beginupdate and endupdate methods on the control or its rows, but they don't seem to work.
I'm not necessarily married to a binding list if there is a better implementation. I really just want to be able to tell an UltraCombo, while it's open, to update the 1,000 or so adjacent records.
Thanks!
Update:
Got this working! The key was using BeginUpdate // EndUpdate in UltraControlBase. This pseudo code worked:
dropdown.BeginUpdate();
/* Get data here */
bindingList.RaiseListChangedEvent = false;
/* Do all updates to binding list except one */
bindingList.RaiseListChangedEvents = true;
/* Do final update to binding list */
dropdown.EndUpdate(true);
The performance is still fast, and it keeps the scroll position as it updates the list.
Great!
An alternative to using BindingList would be to use an UltraWinDataSource and use it's LoadOnDemand