From: JD on
May be this an old subject....

I'm trying to do a simple test (change the position of item 2 to the
first) but I can't do it!

METHOD PBMove( ) CLASS dwX
LOCAL oPoint AS Point

oPoint := oLV:GetItemPosition(1)

oLV:SetItemPosition(2,oPoint)

SetItemPosition should show the item 2 on the first position, right?

So what I missing? Can you help me?

Thanks.

Jairo
From: John Martens on
In this case I always store the new item data in the data-base and
re-read all the listview items so they are in the right place.


Op 25-5-2010 14:23, JD schreef:
> May be this an old subject....
>
> I'm trying to do a simple test (change the position of item 2 to the
> first) but I can't do it!
>
> METHOD PBMove( ) CLASS dwX
> LOCAL oPoint AS Point
>
> oPoint := oLV:GetItemPosition(1)
>
> oLV:SetItemPosition(2,oPoint)
>
> SetItemPosition should show the item 2 on the first position, right?
>
> So what I missing? Can you help me?
>
> Thanks.
>
> Jairo
From: Herbert Putz on
Am Tue, 25 May 2010 05:23:54 -0700 (PDT) schrieb JD:

> May be this an old subject....
>
> I'm trying to do a simple test (change the position of item 2 to the
> first) but I can't do it!
>
> METHOD PBMove( ) CLASS dwX
> LOCAL oPoint AS Point
>
> oPoint := oLV:GetItemPosition(1)
>
> oLV:SetItemPosition(2,oPoint)
>
> SetItemPosition should show the item 2 on the first position, right?
>
> So what I missing? Can you help me?
>
> Thanks.
>
> Jairo

Jairo,

I've never changed the position-property of an item, but when changing
other properties of listviewitems, I always call the update-method of the
listview-object afterwards (listview:update( nItem )).

HTH
Herbert
From: JD on
So... it means SetItemPosition doesn't do that ?!
From: John Martens on
I re-fill the data in the listview (from the data-base) every time the
data is changed.
That certainly isn't done by one of the listview methods.

It will take very short time and you will probably have a separate
method to fill the list-view so it's also not much work to code it like
that.


Op 25-5-2010 18:00, JD schreef:
> So... it means SetItemPosition doesn't do that ?!
 |  Next  |  Last
Pages: 1 2 3
Prev: SO Service Client V1.4.0
Next: ODBC and Unicode