Jump to content

ListView - Sorting


HighGuy
 Share

Recommended Posts

Hi,

has anyone already found a solution for sorting a ListView when clicking on a column header (and maybe reverse sorting when clicking on it again)?

<{POST_SNAPBACK}>

as stated in the doc it is not implemented. It looks like to much code to do event from the script side.

:idiot:

Link to comment
Share on other sites

Indeed, I've done something like that (that's the main reason of my interest in sort algorithms to sort 2D array encording to a given subentry... look here)

As soon as I'll have removed my private code, I'll post here sample version, to show you.

Edited by LazyCoder
A good program computing A into B is mostly one that won't crash in all the other cases...
Link to comment
Share on other sites

OK, let's test this...

In fact I've implemented a lot of functions to easily fulfill my ListView and get its data from a file but, anyway, with this, everyone is free to do this his own way!

Enjoy!

Two little things:

1) There is no bug when sorting the fifth column, but as we are sorting strings, "12" comes before "7" cause it starts with "1"... just to be sure, look, the letters are re-ordered the way they should

2) All this came thanks to a Canadian friend of mine, the same who made me discover AutoIt, so many thanks to him (and if Jon, that my friend simply calls "God", could just drop a line for him, I'm sure it will make his whole day shine even more)

[Edit:]

I forgot to add that I made this as AutoIt code, not as C++ modified code to define a general behavior... it's just a workaround as long as it's not implemented by our AutoIt development fellows!

ListViewSort.zip

Edited by LazyCoder
A good program computing A into B is mostly one that won't crash in all the other cases...
Link to comment
Share on other sites

@Lazycoder,

Looking at the code, it is exactly why I didn't put something inside AutoIT.

On Click on one column the script need to resync the ControlId of the items and the data.

So it is needed that the script memorize the new Controlid related to a specific raw.

It will be possible if the script memorize the data to be in sync as you did.

Congratulation you grade A :idiot: in AutoIt GUI.

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...