Solved

sort in FlexGrid

Posted on 2002-07-11
5
635 Views
Last Modified: 2012-05-07
How do I sort by col1, col4 in FlexGrid ?
0
Comment
Question by:tryforum
  • 3
5 Comments
 
LVL 4

Expert Comment

by:gencross
Comment Utility
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
 

Author Comment

by:tryforum
Comment Utility
no, it does not come with recordset.

I am only able to sort one column at a time.
0
 
LVL 4

Expert Comment

by:gencross
Comment Utility
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
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
Comment Utility
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
 
LVL 4

Expert Comment

by:gencross
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now