IonicWind Software

IWBasic => General Questions => Topic started by: Brian on November 14, 2020, 04:51:13 AM

Title: Sorting problem
Post by: Brian on November 14, 2020, 04:51:13 AM
Help - me no understand! Run the program, listview loads up with the contents of 'Dates.txt'

Each column is sortable, but if you click first on the 'Year' column, it doesn't sort. It only sorts if you click on any of the other columns first. Must be a simple solution

Brian

PS: Update attached to last post in this thread
Title: Re: Sorting problem
Post by: Andy on November 14, 2020, 05:04:23 AM
Brian,

The date code you sent me yesterday works fine in my editor.

The only difference is you are subclassing the listview control, I removed that as I don't need to do that.

Column 1 for me are line numbers, when I click on it, it sorts correctly.

Just noticed this:

Column 1 sort does not work until you have clicked on another column first.
Once you have done that it works.

So that needs looking at...

Andy. 
Title: Re: Sorting problem - The answer
Post by: Andy on November 14, 2020, 05:13:21 AM
Brian,

Before the WAITUNTIL statement put this:

SortAscDesc = 1

Works now.

 :)
Andy.
Title: Re: Sorting problem
Post by: Brian on November 14, 2020, 05:24:19 AM
Well done, Andy. Sorted!

Brian
Title: Re: Sorting problem
Post by: Andy on November 14, 2020, 06:08:09 AM
Your welcome Brian!

It just needed an initial value to begin with.

Anyway, thanks, and it's sorted now.

Andy.
Title: Re: Sorting problem
Post by: Brian on November 15, 2020, 02:49:00 AM
Updated and reposted here with additional calendar icon for you to use

Brian