Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 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 - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Datagrid Multiple Selection
Sankar
Posts: 84
 
Datagrid Multiple SelectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 07 10:56 AM
fiogf49gjkf0d
Can anyone help with multiple selection in datagrid.
Here is the situation:

If i select multiple rows in a datagrid and press the button, i need to display all the selected items in a memo field. Pls help

Thanks
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Datagrid Multiple SelectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 07 1:17 PM
fiogf49gjkf0d
I don't have access to SLX where I am at now, so guessing at the syntax, but here's the rundown for doing multi-select in a SLX grid:

1) In the grid properties make sure MultiSelect is set to True
2) Add your columns to the grid. You must also add the table's primary key value to the grid (you can then set it to hidden, but it must be explicitly added to the grid's layout).
3) Now you'll be able to access the primary key values for the selected rows at runtime via the grid's Selection collection. This will be a collection of the string values for the ID's for each selected row:

ie:

Dim id
Dim idlist
Dim i

For i = 0 to DataGrid1.Selection.Count - 1
id = DataGrid1.Selection(i)

' do something with the ID value
idlist = idlist & id & vbCrLf
Next

MsgBox "Selected ID values are: " & vbCrLf & idlist


Make sense?
[Reply][Quote]
Sankar
Posts: 84
 
Re: Datagrid Multiple SelectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 07 1:57 PM
fiogf49gjkf0d
Thanks a lot Ryan. That was really helpful
[Reply][Quote]
Swapnil
Posts: 46
 
Re: Datagrid Multiple SelectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Mar 07 7:56 AM
fiogf49gjkf0d
Hi Ryan,
Is possible to select multiple rows in datagrid? If not then how can I select multiple rows?
I'm working on version 6.1.2
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Datagrid Multiple SelectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Mar 07 9:17 AM
fiogf49gjkf0d
If you're on 6.1 then you're out of luck with the SLX datagrid. The ability to do MultiSelect wasn't added until 6.2 IIRC.

You're only option is to use a 3rd party grid ActiveX control, or use the ListView instead.
[Reply][Quote]
Swapnil
Posts: 46
 
Re: Datagrid Multiple SelectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Mar 07 11:39 PM
fiogf49gjkf0d
Hi Ryan,
Thanks for your help!
Ryan, Can you give me any example of adding data in ListView. I'm trying to add but not succeeded. I want to add data in ListView from Recordset with check box option to select more than one record at a time.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Datagrid Multiple SelectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Mar 07 6:07 PM
fiogf49gjkf0d
Create a listview on a form, set the property to: and add some columns (we'll say you have three columns, for Account name, type, and web address):

Something like this (untested code):

Dim rs
Dim li

Set rs = Application.GetNewConnection("select * from account where account like 'A%'")
With rs
While Not .EOF
Set li = ListView1.Items.Add
li.Caption = .Fields("account").Value
li.Tag = .Fields("accountid").Value

' to add other columns - ie: sub items
li.SubItems.Add .Fields("type").Value & ""
li.SubItems.Add .Fields("webaddress").Value & ""

.MoveNext
Next
.Close
End With
Set rs = Nothing


Something like that. Beware, that code was from memory, so it may need some tweaks to run, but that should get you the general idea.
[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): 11/27/2024 6:34:41 AM