[Gambas-user] Moving elements in ListView

Tobias Boege taboege at ...626...
Sat Feb 15 00:12:54 CET 2014


On Sat, 15 Feb 2014, Bruce wrote:
> On Fri, 2014-02-14 at 17:01 +0100, Tobias Boege wrote:
> > Hi all,
> > 
> > can someone please help me moving elements in a ListView or tell me that's
> > impossible? I have tried the same three things or so for the last hour and
> > always thought "this time it's gonna work!" but it didn't...
> > 
> > Say I have a list of four elements (#0..#3) and want to move #1 to position
> > #2 so that #2 goes to position #1. A source archive would be enough.
> > 
> > Regards,
> > Tobi
> > 
> 
> Something like this?
> http://paddys-hill.net/wp/gambas/gambas-components/gb-listmgr/
> 
> Bruce
> 

If I understood the code correctly, you implement moving (btnMoveUp ->
MoveItem, LoadList) by managing an internal array which is modified and
then used to generate ColumnView contents from scratch? Nice idea but
this ranks among "workaround" because of two reasons:

 1) it's a ColumnView, not a ListView; we want to operate with ListView only;
 2) we want to use the ListView properties and methods (if at all possible)
    to do the move, not repopulate the ListView with changed data (we have a
    purely theoretical goal here).

I should have said that...

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list