Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NetX/Dialog System: ListView - Part-1

Status
Not open for further replies.

mfcobol2002

Programmer
Feb 3, 2003
73
BR
NetX/Dialog System: ListView - Part-1

Problem:

The field of a listview is alphanumeric, soon a column containing dates with the format DD/MM/YYYY when sorted by the header they would be for us unsorted as dates and ordered alphabetically.

solution:

we created an extra column in the listview with size zero and containing the dates in the format YYYY/MM/DD.
imagine: the column 4 would have the format DD/MM/YYYY and the column 7 would have the format YYYY/MM/DD.
we altered the control program generated by Dialog System in the following way:

local-storage section.
01 num-col pic x(4) comp-5.
--------------------------
Register-Callbacks section.
MOVE '"' & ProgramID & z'Clicked"' TO MessageName
INVOKE EntryCallback "new" USING MessageName
RETURNING aCallback
MOVE P2ce-clicked To i
INVOKE aControl "setEvent" USING i aCallback
INVOKE aCallback "finalize" RETURNING aCallback
*>
-------------------------------------
sortOnColumn section.

Entry ProgramID & "Clicked" USING anEvent.

PERFORM GetDataBlockPointer

INVOKE anEvent "getSelectedItem" RETURNING num-col

if num-col = 4
Move 7 To num-col
Invoke aControl "SortOnColumn" using num-col
End-If

EXIT PROGRAM
.
*>----------------------------------------------------------------


Marcos A.S.
Brasil

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top