Hi all,
I have a sorted grid with three colums. In first and second column I hold strings (e.g. lastname and firstname) in third column numeric data.
In last row of grid:
cell(last-row, 1) = spaces, cell(last-row, 2) = "Total", cell(last-row, 3) = sum(column3).
To be more clear my grid is something like that:
| LastName | FirstName | Sales |
| Sparrow | Jack | 100.00 |
| Lopez | Jennifer | 250.00 |
| Total | 350.00 |
I am trying to sort the grid by clicking the header of column1 and keeping the sum row always at the bottom.
I tried the following:
*
Form1-Gd-1-Ev-Msg-Begin-Sort.
IF EVENT-DATA-1 = 1
INQUIRE Form1-Gd-1, LAST-ROW = WS-LAST-ROW
MOVE HIGH-VALUES TO WS-TMP
MODIFY Form1-Gd-1(WS-LAST-ROW, EVENT-DATA-1) CELL-DATA = WS-TMP
END-IF
.
*
Form1-Gd-1-Ev-Msg-Finish-Sort.
IF EVENT-DATA-1 = 1
MOVE SPACES TO WS-TMP
MODIFY Form1-Gd-1(WS-LAST-ROW, EVENT-DATA-1) CELL-DATA = WS-TMP
END-IF
.
Normaly, when clicking a heading, grid is sorted ascending then after another click, descending etc.
The above code worked only for the first heading click: grid was sorted and sum row kept it's position. But second heading click that should sort the grid descending left the grid unchanged.
Version is 9.2.0
Thank you