Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, May 6, 2024 
 
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!
 Architect Forums - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: Listview Multiselect
Fajar
Posts: 32
 
Listview MultiselectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 May 06 3:34 AM

ct abortion clinics

ct abortion clinics saluslab.com
fiogf49gjkf0d
Hi all,

i have a question, how can i retrieve all selected items (multi select) on a listview control.
i can only retrieve first selected item trough listview.Selected, is there any way to achieve what i aim?

if i use checkboxes, i must iterate through all items in listview to check whether these are the selected items,
but it can decrease performance.

sorry for my lack of knowledge.

thx a lot,
-Fajar
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Listview MultiselectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 May 06 3:34 PM
fiogf49gjkf0d
IIRC, the SLX ListView control is lacking some things like a SelectedItems collection. I believe your only way to do what you are looking for is something like this:

Dim i

For i = 0 To ListView1.Items.Count - 1
If ListView1.Items.Items(i).Selected Then
' notice the wacky Items.Items for the SLX ListView control (not a typo )
MsgBox ListView1.Items.Items(i).Caption & " is selected"
End If
Next
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Listview MultiselectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 06 9:20 AM

naltrexone vs naloxone mechanism of action

when to use naloxone vs naltrexone
fiogf49gjkf0d
I use checkboxes and what Ryan says is true. When you use checkboxes or just select them, you have to iterate through the collections and add things yourself.

Here's how I use a ListView:
1) Set it to details mode
2) Turn on checkbox (which does this for the first "column" or the item)
3) Rename the Item or topmost column to ID.
4) Change the width to be just after ID. This will give you just enough room for the checkbox.
5) Store the primary key in this field and keep it from being resizeable. The width I use you're able to just barely make out that there's data there.

When I use a ListView in this manner I'm always mimicing a datagrid. The remaining "columns" are basically read-only, gathered from the database and discarded after everything's done. Since it only handles string data, I do conversions and handle NULLs (it has a serious problem if you try to put in ""). When I need to do something with this data I read the selected primary key only and do manipulation of the database from there. I built my own ListView class that has a SelectedItems() method to throw the primary keys into an array for multiple items or a string for only one item. I then join the array using "," as the separator, surround the output by () and I can use that in a select in statement. If only the string is returned I use a normal select statement.
[Reply][Quote]
Alan Gates
Posts: 2
 
Re: Listview MultiselectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Mar 07 2:53 PM
fiogf49gjkf0d
Ryan,
This is and excellent (and simple) piece of code. Instead of listing the caption for the main item, how do I access the caption for a subitem?

Thanks in advance!
Alan
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Listview MultiselectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Mar 07 3:02 PM
fiogf49gjkf0d
Quote:
Originally posted by Alan Gates

Ryan,
This is and excellent (and simple) piece of code. Instead of listing the caption for the main item, how do I access the caption for a subitem?

Thanks in advance!
Alan


The subitems are simply a collection of strings. This sample will display in a msgbox the second column (ie: the first subitem) for a given item at index i.

MsgBox ListView1.Items.Items(i).SubItems(0)


Make sense?
[Reply][Quote]
satz
Posts: 75
 
Re: Listview MultiselectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Mar 12 3:57 AM
fiogf49gjkf0d

I have added items and subitems in the listview control. When i see the control in Saleslogix it shows only the items and not the subitems.


How do i make the subitems visible in the Slx screen.

[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 5/6/2024 6:29:43 AM