Sign in to follow this  
Followers 0
pootie tang

Any way to sort SysLiewView based on a certain column

3 posts in this topic

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0