1. ListView Sorting
- Posted by "C Bouzy" <eucoder at hotmail.com> Nov 13, 2005
- 476 views
Hello All, I have a ListView control with two columns, and I am using LVS_SORTASCENDING. Does anyone know how I can set the second column to sort by default instead of the first column? Thanks in advance...
2. Re: ListView Sorting
- Posted by don cole <doncole at pacbell.net> Nov 13, 2005
- 473 views
C Bouzy wrote: > > Hello All, > > I have a ListView control with two columns, and I am using > LVS_SORTASCENDING. Does anyone know how I can set the second column to sort > > by default instead of the first column? > > Thanks in advance... > >
global function readLV(integer id) sequence lData,lheads,line,row line={} row={} lheads = getColumnHeadings(id) -- Output the columns in the right order for i = 1 to getLVCount(id) do for j = 1 to length(lheads) do--the minus one to cut off last col lData = getLVItemText(id, i, lheads[j][1]) line=append(line,lData) end for row =append(row,line) line={} end for return row end function
row is a sequence the length of the ListView
sequence newseq,s2 newseq={} for x=1 to row[1] do newseq=append(newseq,row[2][x])sort by row 2 end for
s2 = sort(newseq)
the second part is untested and my not be exactly right.Don Cole A Bug is an un-documented feature. A Feature is a documented Bug. }}}