Rajesh Karunakaran
Programmer
Hi,
I have a grid showing records from a cursor. All columns control sources are specified (columns from cursor). I have indexes on Barcode, Reference and Product Name. Initially Product Name order is selected and record pointer is on top.
Now, suppose the user selects the 5 record and then click on the Product Name header to toggle Ascending/Descending. But, after that is set, the grid shows the last record as selected. What I would like to do is, even after the Ascending/Descending is toggled or the user clicks on another column header to sort on that column, the earlier selected record should still be shown as selected.
I have the below code on column header Click event and the sorting is working. But, that disturbs the record shown as selected.
The "thisform.reset_slno()" method has below code in it.
Thanks in advance
Rajesh
I have a grid showing records from a cursor. All columns control sources are specified (columns from cursor). I have indexes on Barcode, Reference and Product Name. Initially Product Name order is selected and record pointer is on top.
Now, suppose the user selects the 5 record and then click on the Product Name header to toggle Ascending/Descending. But, after that is set, the grid shows the last record as selected. What I would like to do is, even after the Ascending/Descending is toggled or the user clicks on another column header to sort on that column, the earlier selected record should still be shown as selected.
I have the below code on column header Click event and the sorting is working. But, that disturbs the record shown as selected.
Code:
LOCAL lRecno
lRecno = RECNO('c_products')
IF ORDER() <> 'PRODUCT_NA'
SET ORDER TO PRODUCT_NA
ELSE
IF DESCENDING()
SET ORDER TO PRODUCT_NA
ELSE
SET ORDER TO PRODUCT_NA DESCENDING
ENDIF
ENDIF
thisform.reset_slno()
TRY
GO lRecno IN c_products
CATCH
ENDTRY
thisform.grdList.Refresh()
The "thisform.reset_slno()" method has below code in it.
Code:
LOCAL lRec, lno
lRec = RECNO('c_products')
lno = 0
SELECT c_products
GO TOP
SCAN
lno = lno + 1
REPLACE slno WITH lno
ENDSCAN
TRY
GO lRec IN c_products
CATCH
ENDTRY
Thanks in advance
Rajesh