Hi,
background:
I'm using a flexgrid in VB5 to diplay names and data in multiple columns. Some of the figures have dollars, pounds (sterling) or euro symbols so a straight 'sort' doesn't work correctly.
It works Ok if I copy the 'sort' column to another hidden grid with a second column holding an index vlaue. I can recalculate the value of each sum into sterling and then after sorting refresh the main grid using the index to get it into the right order.
In the main grid I can't use a fixed row 0 for the title, sort-selection, etc, as I want the user to be able to select an item from the grid to display additional info on that item, and if row 0 is fixed then as a user clicks on row 0 to sort on a specific column it returns row 1.
I've got a row of labels above each column and the user will click on a label to sort on that column. The label hold the column title which doesn't get moved with the vertical scroll bar, ie, similar to a fixed row 0.
The up/down arrows showing the sort direction get placed in row 0 and the 'data' goes in row 1 and down from there.
This is all doing what I want it to and although I may have missed some obvious or easier method of doing the same thing I'm happy to leave it as it is, although I'd still like to hear any ides on the subject.
The current problem:
When I scroll down the flex grid a bit and click on a label to sort on a different column it does the sort and changes the display but the grid stays where it is. What I want it to do is to display the grid from row 0 after the sort.
I've tried setting .row 0 and .setfocus, .top. .toprow none of these work as I get an error on them.
Any ideas please?
Regards
Peter
background:
I'm using a flexgrid in VB5 to diplay names and data in multiple columns. Some of the figures have dollars, pounds (sterling) or euro symbols so a straight 'sort' doesn't work correctly.
It works Ok if I copy the 'sort' column to another hidden grid with a second column holding an index vlaue. I can recalculate the value of each sum into sterling and then after sorting refresh the main grid using the index to get it into the right order.
In the main grid I can't use a fixed row 0 for the title, sort-selection, etc, as I want the user to be able to select an item from the grid to display additional info on that item, and if row 0 is fixed then as a user clicks on row 0 to sort on a specific column it returns row 1.
I've got a row of labels above each column and the user will click on a label to sort on that column. The label hold the column title which doesn't get moved with the vertical scroll bar, ie, similar to a fixed row 0.
The up/down arrows showing the sort direction get placed in row 0 and the 'data' goes in row 1 and down from there.
This is all doing what I want it to and although I may have missed some obvious or easier method of doing the same thing I'm happy to leave it as it is, although I'd still like to hear any ides on the subject.
The current problem:
When I scroll down the flex grid a bit and click on a label to sort on a different column it does the sort and changes the display but the grid stays where it is. What I want it to do is to display the grid from row 0 after the sort.
I've tried setting .row 0 and .setfocus, .top. .toprow none of these work as I get an error on them.
Any ideas please?
Regards
Peter