M
Mark Erikson
Okay, I've got a question for you folks. I'm currently working on
creating a C# version of Tillanosoft's TGetFile open/save dialogs
(they don't work with C#, and I'm a cheapskate anyway). I've managed
to solve the majority of my problems, mostly through insane amounts of
Googling, but this one I haven't been able to find an answer for.
The major timewaster in my dialog right now is adding files into the
ListView.ListViewItemCollection. Since the CF ListView doesn't have a
..Sort() method, I've been doing sorting on my own, and managed to get
it pretty fast. However, this means I have to .Clear() the ListView
each time I sort it, and .Add() every item back into the list in the
newly sorted order. I've been testing my dialog against the \Windows
directory, which currently contains about 750 items. Adding those 750
items into the ListView can take anywhere from 5600 milliseconds to
11000 milliseconds - far too long to be acceptable.
As a result, I've been reading up on "virtual listviews". I
understand the basic concept of them, and even found an example in C#
at windowsforms.net. Here's where my problem comes in. The example I
found overrides the .CreateParam sproperty and sets its style to
LVS_OWNERDATA, which is necessary for it to be a virtual listview.
Naturally, the Compact Framework ListView doesn't support
..CreateParams, and apparently doesn't support other styles either.
So, here's my question: is there ANY way possible to set the Compact
Framework ListView style to LVS_OWNERDATA? I can get a handle and do
a SendMessage if necessary. Any help would be GREATLY appreciated,
including possible ideas for optimizing adding ListViewItems or other
techniques for doing a virtual listview with the Compact Framework.
If this can't be done, well... does anyone have any suggestions as to
how to go about creating my own ListView control that I could make
virtual, something like wrapping the MFC or built-in ones? I think
the biggest issue there would be trying to dealing with all the
messages and handling the imagelists and stuff. I really don't want
to have to do that if I can avoid it.
Anyway, thanks in advance for any help you guys can provide.
Mark Erikson
creating a C# version of Tillanosoft's TGetFile open/save dialogs
(they don't work with C#, and I'm a cheapskate anyway). I've managed
to solve the majority of my problems, mostly through insane amounts of
Googling, but this one I haven't been able to find an answer for.
The major timewaster in my dialog right now is adding files into the
ListView.ListViewItemCollection. Since the CF ListView doesn't have a
..Sort() method, I've been doing sorting on my own, and managed to get
it pretty fast. However, this means I have to .Clear() the ListView
each time I sort it, and .Add() every item back into the list in the
newly sorted order. I've been testing my dialog against the \Windows
directory, which currently contains about 750 items. Adding those 750
items into the ListView can take anywhere from 5600 milliseconds to
11000 milliseconds - far too long to be acceptable.
As a result, I've been reading up on "virtual listviews". I
understand the basic concept of them, and even found an example in C#
at windowsforms.net. Here's where my problem comes in. The example I
found overrides the .CreateParam sproperty and sets its style to
LVS_OWNERDATA, which is necessary for it to be a virtual listview.
Naturally, the Compact Framework ListView doesn't support
..CreateParams, and apparently doesn't support other styles either.
So, here's my question: is there ANY way possible to set the Compact
Framework ListView style to LVS_OWNERDATA? I can get a handle and do
a SendMessage if necessary. Any help would be GREATLY appreciated,
including possible ideas for optimizing adding ListViewItems or other
techniques for doing a virtual listview with the Compact Framework.
If this can't be done, well... does anyone have any suggestions as to
how to go about creating my own ListView control that I could make
virtual, something like wrapping the MFC or built-in ones? I think
the biggest issue there would be trying to dealing with all the
messages and handling the imagelists and stuff. I really don't want
to have to do that if I can avoid it.
Anyway, thanks in advance for any help you guys can provide.
Mark Erikson