I know you can set a sort for a grid column by clicking on a column header if enabled in the grid creation in Nomads.
Question: can you get the grid to sort on a particular column using code from within a program? In other words, cause the grid sort without user intervention.
Thanks!
Tom Anderson
Have you tried using grd'sort=col_num or grd'sort$="Col Name" ...?
James,
I tried the following but it doesn't work:
04550 LET GRID'SORT=5
04560 !
04570 GRID LOAD INPF_GRID.CTL,0,0,RR$
Suggestions?
Tom
Try the LOAD first, then the SORT.
If your grid is named INPF_GRID, then you should use INPF_GRID.CTL'sort=5 (or -5 if you want to sort in reverse order). You need to set the 'sort value AFTER data is loaded, and set it again if you reload the grid so that the newly-loaded data is sorted as expected.
Whenever I need to reload a sorted item (grid or listbox), I will store the current sort that the user has selected using logic like "LET cur_sort=INPF_GRID.CTL'SORT". Then, after reloading the data in the grid/listbox, I'll set the sort back to whatever the user had previously selected using "LET INPF_GRID.CTL'SORT=cur_sort"
Got it to work!
Thanks for the assist.
Tom