Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, August 29, 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: Grid Building: Expand and Contract Group Headers, Auto Group Command
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 8:43 AM
Building a Grid on the fly, column by column....

what's the command to Group by Column(1)

WITH grdA
>>> .GROUP(1)

END WITH

And how to I expand that group
grdA.EXPAND ALL

and How do I contract them all
graA.EXPAND FALSE

grdA.REFRESH

HAve done this in the past, but it's on another machine.....
Thanks!
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 11:34 AM
Hi RJ,

To group by a column, you need to get a reference to the column and then set it's GroupIndex property (zero based - you can group by multiple columns the index determines the order of the grouped columns).

ie:

datagrid1.Columns.Item(0).GroupIndex = 0


To expand & collapse, you use Grid level methods:

Expand
datagrid1.ExpandAll


Collapse
datagrid1.CollapseAll


Make sense?
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 11:37 AM
Absolutely, Thanks! Have done this before, just couldn't find any examples of it and this bundle/deployment is in a DB back home.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 07 11:41 AM
Glad I could help.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Mar 08 2:15 PM
datagrid1.Columns.Item(0).GroupIndex = 0

What does GroupIndex = 0 mean vs 1 vs 2

Is the 2nd column Item(1)?

If so, this isn't working in 7.22 Gold. it always is grouping on Item(0).
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Mar 08 2:23 PM
Hi RJ,

Just tested this in 7.2.2 gold and it works for me.

The integer value you set for the GroupIndex indicates the order of the groupings. If I have a grid of activities that include a contact and account name and I want to group by account first, then by contact, I would set the GroupIndex for the account column as 1 and then GroupIndex for the contact column as 2.

Make sense?

-Ryan
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Mar 08 2:23 PM
BTW, the groupindex values are 1-based (whereas the column indexes are 0-based)
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 08 11:39 AM
"

BTW, the groupindex values are 1-based (whereas the column indexes are 0-based)
"

then why does this work?
dgOppProdSites.Columns.Item(0).GroupIndex = 0

If GroupIndex values are 1-based, why does GroupIndex = 0 work?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 08 11:44 AM
Quote:
Originally posted by RJ Samp

If GroupIndex values are 1-based, why does GroupIndex = 0 work?


Well, maybe they are 0-based. Looks like it doesn't matter what numbers you use, as long as they are in order. I'll bet you could use 5 and 6 and it would still work fine (the lower number is grouped first).

Thanks.

-Ryan
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 08 2:31 PM
columns are 0 based, and Group Index's are numerical value based.....
haven't tried identical indexes..... (or identical columns)

Thanks Ryan, this is looking GREAT (had to add a Product Name and OPPPRODUCTID columns together for a distinct product and use that as the Group header, OPPPRODUCTID alone was too ugly).
[Reply][Quote]
Bob Nerren
Posts: 19
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 May 09 11:36 AM
I'm sure the answer is simple but I'm tired of trial-and-error (my usual mode) on this one. How do you then turn off the grouping?

The datagrid I'm working on needs to be grouped or un-grouped based on the data currently displayed.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 May 09 12:19 PM
Quote:
Originally posted by Bob Nerren

How do you then turn off the grouping?.


IIRC you just loop through the columns and set each columns GroupIndex to -1? It's been a while so not sure if I remember that right. Give it a try to see (you could also read an ungrouped column's GroupIndex to see what value it has and use that, but I think it is -1).
[Reply][Quote]
Bob Nerren
Posts: 19
 
Re: Grid Building: Expand and Contract Group Headers, Auto Group CommandYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 May 09 8:27 AM
-1 worked. Thanks Ryan. When I win the lottery, I'm sending you a check. Seriously, your site has saved me an incredible amount of time over the years. Thanks again.
[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/29/2025 3:42:26 AM