Jump to content

Recommended Posts

Posted (edited)

Hi

I have a combo with content which is the result of a SQL query.

Problem is that AFTER populating the combo, user wants to sort the content. Any suggestions?

I could add a button which would re-arrange the underlying array and re-populate the combo without going back to SQL.

Any better, faster ideas?

Thanks

Skysnake

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Posted (edited)
1 hour ago, Skysnake said:

Problem is that AFTER populating the combo, user wants to sort the content. Any suggestions?

In which order does the user want to sort (ascending, descending, natural sorting)? If this is known, you can sort the array before the combo box is populated (but you surely figured this out yourself ;) ). 

In case the user wants an optional sorting, then a button, a select box or a HotKey should be required to trigger this. 

For more than one user, the respective preferences could be stored in an .ini file, for example.

Not that much of a help, I am sorry .

Edited by Musashi
Answer extended

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

😉

The combo actually contains Listview type data (multi column) --- the initial query returns the data in a predetermined sequence (ORDER BY), however now a user wants a different sort order. 

If I understand $CBS_SORT correctly this (very nifty switch) will force the default display to Automatically sorts strings added to the list box, and will override the initial SQL sequence. Not bad if alpha is all you need.

I have decided on a SORT ICON, which will cycle through the different options ... my best solution so far.

@Nine & @Musashi thank you for the interest.

Skysnake

 

 

Skysnake

Why is the snake in the sky?

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
  • Recently Browsing   0 members

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