Re: ListView Sorting

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

row[1] first column ,row[2] the second etc.

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. it might be row[2][x] Test it.

the function is correct though.

Don Cole A Bug is an un-documented feature. A Feature is a documented Bug. }}}

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu