|
-
Jun 9th, 2002, 05:07 PM
#1
problem with sorting a listview
Umm, how can I sort a specified column of a listview control? I'm using a listView with the View set to "Details". I want it to be so that when the user clicks on each column, that column would be sorted. sounds like I can only sort the first column. How can I sort the other columns?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jun 10th, 2002, 05:42 AM
#2
Addicted Member
You need to look at ListViewItemSorter. He is a good post to get you going.
http://www.vbcity.com/forums/topic.asp?tid=2901
Wind and waves resolves all problems.
-
Jun 10th, 2002, 11:05 PM
#3
ok tnx alot it works
for anyone who doesnt want to dig through their stuff, here's how to do it:
VB Code:
Private Class SortOrder
Implements IComparer
Dim Column As Integer
Public Sub New(ByVal aColumn As Integer)
Column = aColumn
End Sub
Public Function compare(ByVal x As Object, ByVal y As Object) As Integer Implements IComparer.Compare
Dim xItem As System.Windows.Forms.ListViewItem = x
Dim yItem As System.Windows.Forms.ListViewItem = y
Return (xItem.SubItems(Column).Text).CompareTo(yItem.SubItems(Column).Text)
End Function
End Class
anyways I have no clue whatsoever how it works
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jun 10th, 2002, 11:55 PM
#4
umm just another question if anyone can help: when option Strict is On, it will give me error from these two:
VB Code:
Dim xItem As System.Windows.Forms.ListViewItem = x
Dim yItem As System.Windows.Forms.ListViewItem = y
it 's because it's converting from object to ListViewItem. What should I do if I want to keep Option Strict on?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|