Moving items in a listview? up and down either dragging or with buttons


Author
Message
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I want to display the contents of a BO in a List/Listview/grid whatever for the sole purpose of the user being able to rearrange or modify the order of the list ( I will then write back the new position into the sequence number field of the table)



Ideally, I would use the new StratalistView control, but it would also be fine to use the current SF Listview. Dragging and dropping to new position with the mouse would be fine, selecting a using arrows to move would be fine or just having buttons to move the item up and down the way it is done with fields in DDT would be fine.



I think I'm missing something easy.



Suggestions?
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I was noodling around with this with Charles and it worked great. We even made a component that you could drop on a form, set three properties and boom, order of items in listview is easily changeable. We made it specific to a SF ListView. He has the latest and greatest SF on Vista.



Then I tried to reproduce this in my environment, XP with 1.6.7. I used a plain old vanilla .NET ListView. It doesn't work. No matter what I use for this line as the index:



this.List.Items.Insert(index, item);




it inserts the item back in the same position. Thus:



this.List.Items.Insert(0, item);

this.List.Items.Insert(34, item);

this.List.Items.Insert(23454, item);




all put the item back exactly in the same position as it was to start. I.e. if the original index of the item is, say, 10, then each of these will put the item back at index 10.



Any ideas what might be causing this? I tried this with a target of 2.0 and 3.5. Same diff.



Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
This is a bit strange and without getting my hands on the code this could be hard to diagnose this way. This is ringing a bell with me but I can't put my finder on the answer....but it does sound familiar?!?
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Here is a sample app. I'm pretty stumped. I upgraded to latest official release (1.7.0.2) and tried it on two machines. They are both XP though.
Attachments
ListViewSequencerSample.zip (145 views, 49.00 KB)
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Has anyone had a chance to take a look at this yet?
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Nope Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Charles R Hankey - 16 Years Ago
Ivan George Borges - 16 Years Ago
Charles R Hankey - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Charles R Hankey - 16 Years Ago
Charles R Hankey - 16 Years Ago
Trent L. Taylor - 16 Years Ago
                 Yep, perfect! Sorry for the silly idea, Charles.
Ivan George Borges - 16 Years Ago
                     Hi Ivan,

Nice to see you back! where have you been? :w00t:
Edhy Rijo - 16 Years Ago
                         Hey Edhy! Well... cruising around the world. (yep, I daydream) Just...
Ivan George Borges - 16 Years Ago
                             I was noodling around with this with Charles and it worked great. We...
Greg McGuffey - 16 Years Ago
                                 This is a bit strange and without getting my hands on the code this...
Trent L. Taylor - 16 Years Ago
                                     Here is a sample app. I'm pretty stumped. I upgraded to latest...
Greg McGuffey - 16 Years Ago
                                         Has anyone had a chance to take a look at this yet?
Greg McGuffey - 16 Years Ago
                                             Nope :)
Trent L. Taylor - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search