sort in FlexGrid

How do I sort by col1, col4 in FlexGrid ?
tryforumAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
TimCotteeConnect With a Mentor Head of Software ServicesCommented:
You *can* sort on multiple columns, however they have to be adjacent. The only viable solution to this is to create two additional columns, containing the same values as col1 & col4 and set the width to 0 effectively hiding these columns. You can then set .Col and .ColSel to select both columns and then .Sort as whichever sort method you prefer.
0
 
gencrossCommented:
I believe you are going to have to do it manually before the data is put into the grid.

Is the data coming from a recordset?
0
 
tryforumAuthor Commented:
no, it does not come with recordset.

I am only able to sort one column at a time.
0
 
gencrossCommented:
This sounds like something you are going to have to sort yourself.

Sort the data by the first column (col1) then retrieve the data from col4.  You can then sort it like you did col1 or put it into an array and run it through a sort routine (There are many array sorting routines as www.planetsourcecode.com  Search for "Sort array")  Once it is sorted load it back into the grid in col4.

If you tell me exactly where the data is coming from and what you are doing there might be a better way of doing it.
0
 
gencrossCommented:
TimCottee is correct.  I did some more playing with the flxgrid and this will work just fine (and a much better solution that I overlooked)

:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.