11/22/2024 7:51:13 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
Moving listview item between 2 listviews
Posted: 20 Apr 06 10:23 PM
|
serevent inhaler coupon serevent inhaler ingredients click here fiogf49gjkf0d Hey, I'm trying to move selected listview item between 2 listview.
At the moment I moved the listview item between 2 listview with this way: ======== Dim lvi1, lvi2 'listview item
Set lvi1 = listview1.Selected Set lvi2 = listview2.Items.Add lvi2.Caption = lvi1.Caption lvi2.SubItems.Add lvi1.SubItems(0) lvi2.SubItems.Add lvi1.SubItems(1) ..... lvi1.Items.Delete(lvi1.Selected.Index) ========== Is there any chance that I can move directly the listview item object into another listview? In vb I can put directly like this way *the syntax is only visualization*: Dim lvi
Set lvi = listview1.Selected listview2.Items.Add lvi
thx, -Fajar |
|
|
|
Re: Moving listview item between 2 listviews
Posted: 22 Apr 06 4:29 AM
|
fiogf49gjkf0d Pls anyone CMIIW,
I've read somewhere, a long time ago (not sure when), taht any ListViewItem, can only belongs to a single ListView object. When you use Set lvi = ListView1.Selected, it doesn't create a new object, but creates a reference to an already existing objects. That's why assigning lvi to another listviews violates the rule. I haven't tested it yet, but this might works
Set lvi1 = listview1.Selected lvi1.Items.Delete(lvi1.Selected.Index)
listview2.Items.Add lvi1
hth
Dhany
|
|
|
|
Re: Moving listview item between 2 listviews
Posted: 24 Apr 06 12:37 PM
|
fiogf49gjkf0d I believe you're actually correct. I have never used 2 listviews but I ran into the object instance thing when I was playing with it initially during 6.1. Since that was about 2-3 years ago by now, my memory is a little off. I also thought that you couldn't really call things like ListView1.Selected.Whatever, you had to set it to something first then make calls to that object. Again memory is fuzzy but it was a little weird compared to other controls.
I made a listview mimic a multi-select datagrid since it was the only control with a checkbox property allowing you to select multiple 'rows'. I placed each primary key ID as the ListViewItem.Caption but shrunk the column so that you could only see the checkbox. This allows me to use a GetItems routine that loops through all items and places the string into an array which I can then pipe to a select * from blah where in (array.split()) statement rather quickly and the majority of operations done from my listviews are done using that primary key only. Yes I still build columns that display data but I process those columns again if I actually want to do something with that data, if that makes sense.
Worst case you could always develop a ListViewItemCopy(Source, Dest) routine that loops through the Source item and subitems then places them in an array (0 being the Item.Caption) or moves them to a brand new listviewitem object. Moving it to an array has very little overhead so it's usually not an issue unless you have a thousand column listview but I doubt anyone would want to use such a thing. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|