[RESOLVED] Urgent help needed: Multiple sorts using Flex Grid
I have some data in a flex grid which is not coming from any database. The grid is filled with data as user selects few objects in the program. I want to sort this data with multiple sorts, how do i do that? I have figured out how to sort with just 1 column by using the grid1.sort = flexsortstringascending, but i dont know how can i sort using column 1 and then by column 2, etc. Any suggestion would be highly appreciated.
Re: Urgent help needed: Multiple sorts using Flex Grid
at the time of entering data in flexgrid, you must sort it in wany you want and then add it.
Re: Urgent help needed: Multiple sorts using Flex Grid
How do i sort it before adding it to the grid. Actually i have a screen where the user selects different items in combo boxes which have the same detail. For example there are total 4 sets of combo boxes (arrays) -
Country
City
Street
The user selects data for 4 sets of country, city and street from the combo boxes. Now i have a loop running from 0 to 3 which sends all this data from the combo boxes into a 3x4 grid. How do i sort the data first by country, then by city?
Re: Urgent help needed: Multiple sorts using Flex Grid
can you give me actual source code .. which you are using ?
Re: Urgent help needed: Multiple sorts using Flex Grid
FlexGrid sorting is good for simple sorting but is restrictive for complex sorting.
Anyways, to sort multiple columns you need to define a Range of columns
The following sorts all rows based on columns 1, 2 and 3.
VB Code:
With FlexGrid
.RowSel = .Row 'forces grid to Sort all rows
.Col = 1
.ColSel = 3
.Sort = flexSortGenericAscending
End With
Note the restrictions
Sorting is always Left to Right
You can only Sort on contiguous columns (ie you cannot sort by col 1, 4 and 7)
You cannot have one column Ascending and another Descending.