473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

ListView Sorting Problem

I am trying to implement the sorting of a ListView object by clicking
on a column (using the example at:
http://msdn.microsoft.com/library/de...tviewsort.asp).
While debugging it I get the following exception:
An unhandled exception of type 'System.OutOfMemoryException' occurred
in System.Windows.Forms.dll

Additional information: Error creating window handle.
It is occuring at any line where I try to set the listView.Sorting
property. For example:

this.listView.Sorting = SortOrder.Ascending;
The moment I comment this line out, the exception goes away. I was
wondering if anyone had encountered this before or knew what is causing
this.

Thanks,
Steve

Jul 13 '06 #1
2 1921
Most likely something is wrong in your sorting routine, but you didn't show
that code so... (the code in the article works fine for me)

/claes

"Steve Z." <zo******@msoe.eduwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
>I am trying to implement the sorting of a ListView object by clicking
on a column (using the example at:
http://msdn.microsoft.com/library/de...tviewsort.asp).
While debugging it I get the following exception:
An unhandled exception of type 'System.OutOfMemoryException' occurred
in System.Windows.Forms.dll

Additional information: Error creating window handle.
It is occuring at any line where I try to set the listView.Sorting
property. For example:

this.listView.Sorting = SortOrder.Ascending;
The moment I comment this line out, the exception goes away. I was
wondering if anyone had encountered this before or knew what is causing
this.

Thanks,
Steve

Jul 14 '06 #2
Code for sorting is identical to that which is in the article. Strange
thing is, if I move the sorting code to a test project, it works fine.
Or if I go to debug and step through the code, it is fine. It doesn't
make sense how just changing a property should result in this error.

Jul 14 '06 #3

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

Similar topics

0
by: rmorvay | last post by:
I have successfully integrated sorting in the listview control with the following code: Private Sub ListView_ColumnClick(ByVal sender As Object, ByVal e As...
2
by: Anushya devi | last post by:
Hi All I used listview and tried to update it by using Addrange. When the number of items is less, it works fine.. But I need to update nearly 200,000 items and it hangs. Also i need to add...
0
by: Abhishek | last post by:
Hi! I am using listview control having 4 columns. I want it to behave in a similar manner as the details view of windows explorer. i.e it should sort on all the columns and all the columns...
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...
2
by: Li Pang | last post by:
Hi, I use a listview to populate the data, and define a sorting direction with Me.ListView1.Sorting = System.Windows.Forms.SortOrder.Ascending so far no problem. As long as I add a new row...
3
by: Curtis | last post by:
I am trying to do a simple sort on a list view.With the listview control the first time I sort on the control it sorts the items but anytime after that it fails to sort. I'm sure this is a simple...
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...
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...
2
by: win | last post by:
The SortKey of VB6 is not in .Net. Can I still do sorting using a listview? Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.