Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 25, 2025 
 
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: how do I specify a combobox in a datagrid, so I can add to its items in script
Brian Kempe
Posts: 53
 
how do I specify a combobox in a datagrid, so I can add to its items in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 06 3:37 PM
fiogf49gjkf0d
Sub PopulateComboBox
datagrid1.Project_Parent_Status.Items.Add "Active"
datagrid1.Project_Parent_Status.Items.Add "Inactive"
datagrid1.Project_Parent_Status.Items.Add "On hold"
datagrid1.Project_Parent_Status.Items.Add "Closed"
End Sub

Didnt work.
The datagrid is named datagrid1 the column I changed to type combobox is the thrid column and is filed name Project_Parent_Status
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: how do I specify a combobox in a datagrid, so I can add to its items in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 06 6:05 PM
fiogf49gjkf0d
You're close, but not sure what you're expecting for "Project_Parent_Status"

You need to know the columns index, or loop through all columns first and check my field name that it is bound to, either way, once you get a reference to the index, you just add items to the Items collection.

Dim col

Set col = DataGrid1.Columns(1) 'assume my combo column is at index 1
col.Items.Add "Active"
col.Items.Add "Inactive"
col.Items.Add "On Hold"
col.Items.Add "Closed"


Alternatively, you could make it a picklist column, add these items to a picklist and then just set the picklist for the column. Of course, I assume that the reason you need to do this programatically is because you won't know the items to set until runtime.
[Reply][Quote]
Brian Kempe
Posts: 53
 
Re: how do I specify a combobox in a datagrid, so I can add to its items in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 4:52 PM
fiogf49gjkf0d
My problem stems from the fact that I cannot add the Text Column from the PICKLIST table in the layout box of a datagrid. Perhaps there is a workaround you can tell me about.
Otherwise It is my wish to cycle through each result row of a datagrid and replace "datagrid.GetCurrentField(A2_StatusCode)" with
result from "Select from PICKLIST where itemid= '" & datagrid.GetCurrentField("A2_StatusCode") & "'"


Been trying four five hours now and I give up.
Please help
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: how do I specify a combobox in a datagrid, so I can add to its items in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 5:23 PM
fiogf49gjkf0d
If you want the values in the drop down to be dynamic based on some value of the selected row then there is a few things to remember.

For both combo columns and picklist columns, the values in the drop down are for *all* rows. That is, each row does not have it's own drop down list. When you set the values in the combo (or the picklist to use for a picklist column) it applies to all rows in the grid. So, what that means is that you have to programatically set the values in the combo (or list to use for a picklist column) when a row is selected in the grid. Each time the user clicks a row, your code will run to set the values in the drop down for the combo column. There's no way to pre-fill that for each row since it applies to all rows in the grid (shared).

It is simpler than it sounds, I've done this a few times and the performance hit wasn't even noticeable.

Make sense?
[Reply][Quote]
Brian Kempe
Posts: 53
 
Re: how do I specify a combobox in a datagrid, so I can add to its items in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 7:35 PM
fiogf49gjkf0d
I have miscommunicated my issue. I don't really want a drop down in my datagrid. The column in the data grid "Status" was originally generated from a form with a picklist. So when I try and display the data grid I get ID's that link to the picklist table, instead of "Open" or "Closed". I am currently working on a very nasty workaround I have created a table called Picklist_Ext and am copying the data from Picklist to Picklist_Ext. Then I am creating a join form Tickets to Picklist_Ext and Voila I can choose the status field in the datagrid layout page. The biggest problem with this is that My new table is not dynamic and cant be updated by accessing Picklists, But its better then nothing.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: how do I specify a combobox in a datagrid, so I can add to its items in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 9:53 PM
fiogf49gjkf0d
Uhm couldn't you just create a local join in the query builder for the grid to link the picklist item?

Login to the client as admin and look at the ticket groups, specifically My Tickets or Overdue. There's a condition for Ticket.PickList.Text, which is a local join created to join the statuscode to the picklist itemid and it returns the value of the status like Open, Closed, etc. Anything that uses Query Builder can create a local join that applies only to that control or function (lookups, grids, groups, etc.). All you do to create the local join is select the field in the top portion of the Query Builder then right click and select "Create Local Join". You then select the field to join and set the join type and off you go.

I think this is what you're looking for but I'm not sure. I ran into this problem early in my ticket customizations but I never had the thought of using an extension table. I would have left them as itemid's had I not noticed that the groups were doing what I was looking for.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: how do I specify a combobox in a datagrid, so I can add to its items in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 9:59 PM
fiogf49gjkf0d
Ah, now I see. I did misunderstand.

Anyway, see Jeremy's post regarding joining to the ticket table to retrieve the values. That will do what you need.
[Reply][Quote]
Gerald Clark
Posts: 2
 
Re: how do I specify a combobox in a datagrid, so I can add to its items in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Aug 08 4:35 PM
I am trying to dynamically populate the combobox in the way you described. I can get the comboboxes to populate however when i select an option everything is cleared. I assume its because it keeps running the onrowselect sub. How can i fix this? any help would be greatly appreciated. Thanks

Sub dgBuildingItemsRowSelect(Sender)

Dim col
Set col = dgBuildingItems.Columns(1)

dgBuildingItems.Columns(1).Items.clear 'clear combobox before adding new items

dim strsql, objSC, objSLXDB, I
Set objSLXDB = New SLX_DB
Set objSC = objSLXDB.GetNewRecordSet

strsql = "Select name from table"
objSC.open strSQL, objSLXdb.connection
cbBuildingType.Items.clear

With objSC
If Not (.BOF And .EOF) Then
.MoveFirst
For I = 0 To .RecordCount - 1

col.Items.Add objSC.Fields("PRODUCT_NAME").Value

.MoveNext
Next
End If
End With

objSC.Close
Set objSC = Nothing

End Sub
[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 © 2025 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): 8/25/2025 1:08:05 AM