6/20/2025 1:34:18 AM
|
|
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 writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Expand datagrid group on one value
Posted: 16 Aug 07 3:12 PM
|
I see how to either .ExpandAll or .CollapseAll, but is there a way to expand only one of the group items? I have a datagrid whose recordset is not connected to a database. I have several checkboxes within a record that users will select items with.
Here is the symptom: With ExpandAll, if a user checks an item in one of the groups, that is fine, no problem. If another check is made in the same record, or in another record within that group, then all the other groups collapse. Plus, the grid jumps and the record I clicked on is not the record that gets checked. Before I did my grouping, I fixed that jumping problem by setting UseVSSC to True, but now in the grouping it does it again on the second click - not the first, and not the third-plus clicks...just the second one.
So actually, I have two issues I guess.
1. How to expand just one group based on one value in that group. 2. How to stop the cursor jumping to another record when clicking the grid a 2nd time.
Here is my code for populating the grid, if it helps at all.
Dim objRS, objSLXDB, strSQL, rst, Output
Set objSLXDB = New SLX_DB Set objRS = objSLXDB.GetNewRecordSet Set rst = CreateObject("ADODB.Recordset") rst.CursorLocation = 3 'adUseClient rst.LockType = 4 'adLockBatchOptimistic
'adVarChar = 200 rst.fields.Append "Category", 200, 20 rst.fields.Append "Queue", 200, 1 rst.fields.Append "Select", 200, 1 rst.fields.Append "Copies", 3 'adInteger rst.fields.Append "Description", 200, 100 rst.fields.Append "Printer", 200, 64 rst.fields.Append "Print", 200, 1 rst.fields.Append "Email", 200, 1 rst.fields.Append "Catalog", 200, 1 rst.fields.Append "CLSDOCUMENTID", 200, 12 rst.open
strSQL = "Select * from CLSDOCUMENT where ACCOUNTID = 'ABENJ0000007'" objRS.Open strSQL, objSLXDB.Connection Do While Not objRS.EOF
rst.AddNew rst.fields("Select") = "F" If Not IsNull(objRs.fields("DEFAULT_COPIES")) Then rst.fields("Copies") = objRs.fields("DEFAULT_COPIES") Else rst.fields("Copies") = 1 End If rst.fields("Description") = NullToString(objRs.fields("DESCRIPTION")) rst.fields("Printer") = Trim(NullToString(objRs.fields("SPECIFIC_PRINTER"))) Output = NullToString(objRs.fields("OUTPUT_DEFAULTS")) If Output = "P" Or Output = "B" Or Output = "F" Or Output = "A" Then rst.fields("Print") = "T" Else rst.fields("Print") = "F" End If If Output = "E" Or Output = "B" Or Output = "D" Or Output = "A" Then rst.fields("Email") = "T" Else rst.fields("Email") = "F" End If If Output = "C" Or Output = "F" Or Output = "D" Or Output = "A" Then rst.fields("Catalog") = "T" Else rst.fields("Catalog") = "F" End If rst.fields("CLSDOCUMENTID") = objRs.fields("CLSDOCUMENTID") rst.fields("Category") = objRs.fields("CATEGORY") rst.fields("Queue") = "F" rst.Update objRs.MoveNext
Loop objRs.Close
grdPrintPro.Columns(0).FieldName = "Category" grdPrintPro.Columns(1).FieldName = "Select" grdPrintPro.Columns(2).FieldName = "Queue" grdPrintPro.Columns(3).FieldName = "Copies" grdPrintPro.Columns(4).FieldName = "Description" grdPrintPro.Columns(5).FieldName = "Printer" grdPrintPro.Columns(6).FieldName = "Print" grdPrintPro.Columns(7).FieldName = "Email" grdPrintPro.Columns(8).FieldName = "Catalog" grdPrintPro.Columns(9).FieldName = "CLSDOCUMENTID" grdPrintPro.Columns.Item(0).GroupIndex = 0
grdPrintPro.Recordset = rst grdPrintPro.Refresh grdPrintPro.ExpandAll
Thank you! |
|
|
|
Re: Expand datagrid group on one value
Posted: 17 Aug 07 12:31 PM
|
Originally posted by Paul VanderWaal
I see how to either .ExpandAll or .CollapseAll, but is there a way to expand only one of the group items? |
|
Sorry to say, nope. The expanding/collapsing of groups in the SLX grid is extremely limited. Your only choice is all or nothing. IIRC, at one time, the group with selected record(s) in them would remain expanded, not sure if it still works that way now or not.
-Ryan |
|
|
|
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!
|
|
|
|
|
|
|
|