|
-
Jun 11th, 2003, 04:32 AM
#1
Thread Starter
Lively Member
Sorting lisview (SOLVED)
I have put some code to sort listview detail when columnclick.
I would like to display the sorted column in grey like explorer.
Private Sub ListView1_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles ListView1.ColumnClick
' Determine if the clicked column is already the column that is
' being sorted.
If (e.Column = lvwColumnSorter.SortColumn) Then
' Reverse the current sort direction for this column.
If (lvwColumnSorter.Order = SortOrder.Ascending) Then
lvwColumnSorter.Order = SortOrder.Descending
Else
lvwColumnSorter.Order = SortOrder.Ascending
End If
Else
' Set the column number that is to be sorted; default to ascending.
lvwColumnSorter.SortColumn = e.Column
lvwColumnSorter.Order = SortOrder.Ascending
End If
' Perform the sort with these new sort options.
Me.ListView1.Sort()
'Me.ListView1.Columns.Item(e.Column). = Color.LightGray ?????
End Sub
What the exact code ???
Thanks
Last edited by oxbow123; Jun 12th, 2003 at 07:58 AM.
-
Jun 11th, 2003, 07:38 AM
#2
Sleep mode
What's this variable : lvwColumnSorter ?
-
Jun 11th, 2003, 08:00 AM
#3
Thread Starter
Lively Member
Private lvwColumnSorter As ListViewColumnSorter
ListViewColumnSorter is a class where compare function is coded
-
Jun 11th, 2003, 08:09 AM
#4
Sleep mode
VB Code:
Me.ListView1.Columns.Item(0).ListView.Items(0).BackColor = Color.LightGray
-
Jun 11th, 2003, 08:38 AM
#5
Thread Starter
Lively Member
it is the line which is in grey and not the column
-
Jun 11th, 2003, 09:21 AM
#6
Sleep mode
Originally posted by oxbow123
it is the line which is in grey and not the column
I don't think there is such a property then for setting the column backcolor in details view .
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
|