(Slightly OT, but pertinent) - I can’t use Kem’s DoD list because I’m already committed to my already mass-featured ListBox, but I did do some simple plumbing on it and my ListBox does data on demand too.
DoD is great, because your list speeds up so much faster. I don’t agree withe Beatrix’s number - I think after 1000 is when you should start thinking about DoD.
However, one thing I didn’t anticipate was that any multiselection beyond the visible limits doesn’t work, and then I realized that it would take much more plumbing to accomplish.
Kem, does your DoD handle multiple selection (in and outside the view, with the many ways you can multi-select) seamlessly, and are there any tips you can recommend about it?
[quote=34213:@Richard Duke]Data-On-Demand ListBox subclass look really good. Will adapt to my application and then if it work well, get it from ur website.
I assume i can compile it ??[/quote]
Yes, but a standalone app requires a license. There are no limits to using it within the IDE.
I just realized that I have an update sitting on my drive that I should really post. I’ll try to do that today.
My ListBox started with Alex Restrepo’s CustomCellListBox. I then modified it extensively, to allow selectable columns and many other things (like many custom cells). I’m happy to send it out, but I wonder how easy it would be for someone else to use.
The problem I predict with the multiselect is handling all the different ways people can multiselect, for example selecting a row, pressing SHIFT, clicking the scroll downwards (full step), and clicking on another row. This multiselects from the first row selected to the second row selected.
Maye this is easier than I’m thinking, it’s just a little scarier thinking about it… =)
Kem, where is the vertical scrollbar i need for DoD??
based on this statement on your manual.
“If you want a vertical scrollbar, add that to the window and line it up with the ListBox. Because of the nature of the Data-On-Demand ListBox, you cannot use the ListBoxs own vertical scrollbar. Attempting to do so will result in an error.”
Have you tried making the Listbox invisible, populating it, then making it visible again? This makes populating it faster. You can always put a dummy blank Listbox over it to make the UI look OK while it is working.
[quote=34264:@Richard Duke]Kem, where is the vertical scrollbar i need for DoD??
based on this statement on your manual.
“If you want a vertical scrollbar, add that to the window and line it up with the ListBox. Because of the nature of the Data-On-Demand ListBox, you cannot use the ListBoxs own vertical scrollbar. Attempting to do so will result in an error.”[/quote]
You create a standard, vertical scrollbar, then assign it to DOD in the DOD subclass Open event (it’s the only parameter to Open). DOD will manage the ScrollBar after that. In the ScrollBar’s ValueChanged event, you assign the DOD’s ScrollPosition.
This is in the example projects and elsewhere in the manual.
I’ve had more success with this on OSX than Windows, which doesn’t work that well, disappears while it loads the data. if I have a large data set, I almost always just get out the Einhugur StyleGrid, which has Lockdrawing properties. Much smoother for big data sets than the list box, at least on Windows. I like to work with the ListBox where possible, but sometimes that just isn’t practical.