(no GUI updates).
That, in essence could be what C# is doing. It's simply adding to a
collection every time they add a row but no GUI stuff is happening.
The GUI stuff happens the same as it does for a virtual list control. You
could do something similar for MFC.
Yes, I guess it's like anything else. When you know how to do it ... it
seems easy, but when you don't it seems more difficult. I'm not sure how
they are doing a virtual list by adding each item like that unless they
are just using a callback, but not really making it virtual. Seems like
just as much trouble if you have to add all the "rows" in a loop like
that rather than just using external data.
Tom
"Giovanni Dicanio" <giovanniDOTdicanio@REMOVEMEgmail.com> wrote in
message news:eX7XVPpSJHA.1184@TK2MSFTNGP03.phx.gbl...
"Tom Serface" <tom.nospam@camaswood.com> ha scritto nel messaggio
news:02461D6B-4548-4346-BCA1-CD1852FF8979@microsoft.com...
It can easily be done with MFC now :o)
I think not.
Now with MFC the default behaviour with CListCtrl::InsertItem is a
"non-virtual" listview control, which takes lots of time to be filled
with non-trivial amount of data.
You have to use owner-data and answer the LVN_GETDISPINFO, etc. to have
decent performance.
Not very complex, sure, but not as easy and intuitive as doing some
calls to InsertItem in a loop.
Instead, I just verified that the default behaviour with .NET WinForms
listview is that a simple loop like this:
foreach ( some data to read )
{
// Read record data from source
...
// Add to listview
listview.Items.Add( newItem );
}
works fine also for 80,000+ items.
Giovanni