Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Wed Aug 27, 2008 5:06 am Post subject: HOWTO: Sort items programmatically |
|
|
Use the SortByColumn method to programmatically sort items as shown below:
[C++]
//Sort by 'Name' in ascending order
//SortOrders.Ascending = 1
m_fileVw.SortByColumn(_T("Name"), -1, 1) ;
[VB6]
fileVw.SortByColumn "Name", -1, SortOrders.Ascending 'Sort by 'Name' in ascending order
The same method can also be used to toggle the sort order as shown below:
[C++]
//Toggle sort order by 'Name'
//SortOrders.Toggle = 3
m_fileVw.SortByColumn(_T("Name"), -1, 3) ;
[VB6]
fileVw.SortByColumn "Name", -1, SortOrders.Toggle 'Toggle sort order by 'Name' |
|