Jump to content

Any way to sort SysLiewView based on a certain column


Recommended Posts

Is there any way to specify a column and sort ascending or descending on a SysListView control. I used to use the ListView and Header functions from Auto3Lib to accomplish. I looked at _GUICtrlListView_SortItems and _GUICtrlListView_SimpleSort but not sure how to get them to work. Thanks in advance.

Link to comment
Share on other sites

Get the ControlID of the listview (Autoit3 Window Info Tool)

Get the Handle of the control from the control ID ( ControlGetHandle() )

Pass the Handle to your _GUICtrlListView_SortItems() or _GUICtrlListView_SimpleSort() functions

Link to comment
Share on other sites

Get the ControlID of the listview (Autoit3 Window Info Tool)

Get the Handle of the control from the control ID ( ControlGetHandle() )

Pass the Handle to your _GUICtrlListView_SortItems() or _GUICtrlListView_SimpleSort() functions

Paulie,

Thanks. For SimpleSort, I'm not exactly sure about the use of the 2nd argument. From the example, it looks like an array that is declared to be the size of the number of columns. The items in the syslistview cannot be removed and put back. When I tried to use it as:

Global $B_DESCENDING[_GUICtrlListView_GetColumnCount($hlv)]

_GUICtrlListView_SimpleSort($hlv,$B_DESCENDING,1)

where $hlv is the handle returned from controlgethandle, it crashes the .NET application.

I need to be able to click the appropriate column and have it be ascending or descending.

any thoughts? Thanks.

Edited by pootie tang
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...