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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listview - sort

Status
Not open for further replies.

Xkarlos77

Programmer
Jan 19, 2003
28
0
0
CZ
is there any way how sort the column with number ??
when I use sort I become :
1,
12,
3,
13,
.....
and i want :
1,
3,
12,
13.

thanks
 
That is the way the control sorts numbers - it sees it as text. You can overcome that by sorting the array (with a simple sort routine) and then writing it to the control. Otherwise you might sort the recordset with the SQL and then write to it (if you are reading from a database. PK Odendaal
pko@942.co.za

 
i want that the user can sort it by click on header.
 
When I put FileSize into the ListView subitem, I right justify with leading spaces.
' Assuming 8 positions for size.
' Put 8 spaces on the left then take the rightmost 8 characters.
lstv.Items(idxSize) = Right$(Space(8) & CStr(marySize(I)), 8)

Now it will sort properly and look better in the list. Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top