#129976 - 2004-11-21 12:57 PM
Re: Listview sorted!?!?!
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
I already test that. Its not working... The ini file is not alphabetically intact. the listed items in listview is in same order as items are in ini file. $ListView.Sorted = "True" seems not sort it properly.˝!"# And why is that?
_________________________
I will always look out from behind these eyes...
|
|
Top
|
|
|
|
#129979 - 2004-11-21 04:56 PM
Re: Listview sorted!?!?!
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
So why is this not working?
$lsvList1 = $Form.ListView
$lsvList1.Height = 425 $lsvList1.Left = 12 $lsvList1.Top = 15 $lsvList1.Width = 200 $lsvList1.MultiSelect = 0 $lsvList1.Dock = "Left" $lsvList1.OnDoubleClick = "lsvList1DC()"
$ = $lsvList1.Columns.Add("Name",180) $ = $lsvList1.Columns.Add("Version",80) $ = $lsvList1.Columns.Add("Path",0) $ = $lsvList1.Columns.Add("ID",0)
$SWProd = "\\Server1\Share\Software1\Prroduct1.ini"
$Item0 = $lsvList1.Items.Add("")
$key = ReadProfileString($SWProd,"","") For Each $Keys In Split($key,Chr(10)) If $Keys $Item = $lsvList1.Items.Add() $Item.Text = "Item" $Name = ReadProfileString($SWProd,$Keys,"SWName")+@CRLF $Item.Subitems(0).Text = $Name $Ver = ReadProfileString($SWProd $Keys,"SWVersion")+@CRLF $Item.Subitems(1).Text = $Ver $Path = ReadProfileString($SWProd,$Keys,"SWPath")+@CRLF $Item.Subitems(2).Text = $Path $Item.Subitems(3).Text = $Keys $NmVr = $Name + $Ver $lsvList1.Columns.Sorted = "True" $lsvList1.item.Sorted = "True"
$lsvList1.HideSelection = "true" EndIf I have 3 listviews reading items from 3 diffrent ini files plased on diffrent servers.
hmmm... what about listbox instead of listview...
_________________________
I will always look out from behind these eyes...
|
|
Top
|
|
|
|
#129983 - 2004-11-22 01:22 AM
Re: Listview sorted!?!?!
|
Anonymous
Anonymous
Unregistered
|
Well, instead of this
$lsvList1.item.Sorted = "True"
it looks more like this:
$lsvList1.Sorted = "True"
so do that first, then - when you go to add an item ,make sure you do this:
$Item = $lsvList1.Items.Add("Text")
and not this:
$Item = $lsvList1.Items.Add()
$Item.Text = "Text"
Edited by Jooel (2004-11-22 08:03 AM)
|
|
Top
|
|
|
|
#129984 - 2004-11-22 01:29 AM
Re: Listview sorted!?!?!
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Come-on Shawn. The least you could do is stand up for your code. Logon and quit hiding.
|
|
Top
|
|
|
|
#129985 - 2004-11-22 02:19 PM
Re: Listview sorted!?!?!
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
aj aj aj, my bad...
$key = ReadProfileString($SWProd,"","")
For Each $Keys In Split($key,Chr(10)) If $Keys
$lsvList1.Sorted = "True"
$Name = ReadProfileString($SWProd,$Keys,"SWName")+@CRLF $Item = $lsvList1.Items.Add($Name) $Item.Subitems(0).Text = $Name
...and it works!
_________________________
I will always look out from behind these eyes...
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1046 anonymous users online.
|
|
|