ListView Item and Memory

M

Mystique

Hello
I have a ListView and a form for entering data. When the user is finished
entering the data he presses AddToListView. Then there is a large object
that is being filled with data that the user has entered and the object is
added to the ListView. Then I call:

listView1.Items[listView1.Items.Count-1].Selected = true;
listView1.Select();

so the item gets autmatically selected.

On the first line of the code above the process hangs for a long time, and
it seems that the memory consumption rises during this.

Can somebody tell me is this a known problem or is there any way out of it?



Regards,

Mystique
 
P

Per Rollvang

[SNIP]
On the first line of the code above the process hangs for a long time, and
it seems that the memory consumption rises during this.

Can somebody tell me is this a known problem or is there any way out of
it?

The delay in execution of a selected line of code usually have to do with
code
executed prior to the line you refer to, thus, the 'select-item'-line may
not be the
bottleneck.

If you have severe problems with loading data into a listview, I suggest you
google
the virtualmode of the listview, because in virtual-mode, the only loaded
items is the
visible ones, thus eliminating the GUI-overhead...
Regards,

Mystique

HTH
-Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top