473,473 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is there some way I can speed up a ListView sort?

I have a ListView that has about 200 rows and 15 columns.
When I execute "Sort" it takes minutes to sort.

I did implement my own ICompare object but the Function Compare is simple,
much like the one in Help to sort columns.

Is there some way I can speed this up?
Thanks
Nov 21 '05 #1
8 1609
Developer,

Maybe needles to say, however you did of course already set the

listview.beginupdate and listview endupdate

before and after the sort?

http://msdn.microsoft.com/library/de...pdatetopic.asp

Anyway, I hope this helps,

Cor
Nov 21 '05 #2
Thanks Cor
I did try that, but the problem was a simple convert from string to integer
before comparing, so as to sort integers OK.
Converting for each comparison took much time.
I just found it.
Thanks

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...
Developer,

Maybe needles to say, however you did of course already set the

listview.beginupdate and listview endupdate

before and after the sort?

http://msdn.microsoft.com/library/de...pdatetopic.asp

Anyway, I hope this helps,

Cor

Nov 21 '05 #3
I have another post to which I received no reply.

The subject is:
What could possibly be happened as End is executing that causes the
exception

I'd sure like a suggestion of something to try.

Is there a tool that might help me see what is being done after End is
reached?

Any suggestion at all - have no idea how to proceed.

I've tried commenting out blocks of code but to no avail.
I wonder if you'd think about it for a minute or two?

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...
Developer,

Maybe needles to say, however you did of course already set the

listview.beginupdate and listview endupdate

before and after the sort?

http://msdn.microsoft.com/library/de...pdatetopic.asp

Anyway, I hope this helps,

Cor

Nov 21 '05 #4
Developer,

There should be nothing happening after the *end*. *End* means killing the
program, a statement you normally should not use however maybe there happens
outside your program something because of that killing.

Cor
Nov 21 '05 #5
I'm sorry, I meant End Sub.
My program crashes after it leaves an event handler.
It is an event raised by a ComboBox.
So the stack contains only the handler and Main before the End Sub is
executed.

What I see during debugging is:

When I press F11 at the End Sub statement

In Main I catch the following exception:

An unhandled exception of type 'System.Runtime.InteropServices.SEHException'
occurred in system.windows.forms.dll

Additional information: External component has thrown an exception.

1. What could possibly happen as End Sub is executing that causes the
exception?
2. What does External component mean. Is the ComboBox an External component?
3.Is InteropServices.SEHException' a clue? Or is that the typical exception


Thanks


"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
Developer,

There should be nothing happening after the *end*. *End* means killing the
program, a statement you normally should not use however maybe there
happens outside your program something because of that killing.

Cor

Nov 21 '05 #6
Hi,

Have a look in your references (which you can find in the solution exlorer)
if there is something with interop.SEHE or whatever.

I hope this helps,

Cor
Nov 21 '05 #7
yes, I have read the stuff about SEHException but it doesn't tell me much.
I suspect the error comes from some Windows API call (if that's a "legacy
system") that I've messed up but can't imagine what is being run after the
End Sub.
thanks

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uD*************@tk2msftngp13.phx.gbl...
Hi,

Have a look in your references (which you can find in the solution
exlorer) if there is something with interop.SEHE or whatever.

I hope this helps,

Cor

Nov 21 '05 #8
I just reread it and now wonder if it relates to COM. If it does I'm really
confused about the cause.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uD*************@tk2msftngp13.phx.gbl...
Hi,

Have a look in your references (which you can find in the solution
exlorer) if there is something with interop.SEHE or whatever.

I hope this helps,

Cor

Nov 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: neelu | last post by:
I have four columns in listview. SR Number Part# DES Qty Weight 59 9410106800 Nut 10 0.03 60 90304ge800 Helmet 5 0.325 61 9635439604 ...
1
by: Richard | last post by:
Hi. I subclassed a ListView to give it the capability to sort by a column when the column header is clicked and it works fine. The problem is when the listview gets refreshed, all items are cleared...
5
by: billuy | last post by:
Is there a way to sort by a specified column in a listview? I'd like my users to be able to click on the column heading and have the listview sort by that column. Thanks, Billyb
1
by: Mamatha | last post by:
Hi I have one application ,that diplays data from database into the listview control.While adding data to the listview i want to display an icon to the leftside of the first column's data.Here...
0
by: Terry Brown | last post by:
I have a form which contains a listview item. The form is created to view data that is generated by interaction with a separate form. There are buttons on the form that change the data source...
6
by: Dave | last post by:
VB6 has a SorkKey property that you can setup on the ListView control to tell the ListView what column to use for sorting. In .NET there is a Sort() method and a SortOrder property that you can...
11
by: Alan T | last post by:
Does the ListView supports sort? I want to have a up/down arrow/triangle that show it is sorted asc or desc on the column headers when I click the column header. May be I need a third-party...
3
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005, .net 2 for C# windows application. One of my column on the Listview control has numericstring. Other columns are sorting correctly except this one. It seems to be sorting...
0
by: bharathreddy | last post by:
Hi All, I am using a listview control in my usercontrol so that it can be used in more than one form. This user control has one column extraw, so i want to make it invisible depending on the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.