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: List Views Manipulation (again!): Captions and Widths derivation!
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
List Views Manipulation (again!): Captions and Widths derivation!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Oct 09 3:45 PM
This is kind of like GRID stuff deja vu......you have a recordset and maybe a caption (if it's in the grid)....but no easy way to reset a grid to a List Views specifications.

You can get the selected ID's, all of the ID's, the SQL....but no way to figure out the Formatting, Width, Alignment of each column?

Knowing that I have developed a few tools to take SQL Select statements\Record Sets and come up with pretty column captions, and the Field type (which can allow for format setting AND width).....does anyone have a quick way to determine the width.....

Maybe you walk X records of the grid and determine the max length of the field value? take that number add 10 to it and there's your width?

It's easy to set all of the INTs, Double, Currency, etc. to, say 60....but Account Type, City, State, Country, Account, Contact LastName, etc. are tougher....

So has anyone come up with a quick solution?
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: List Views Manipulation (again!): Captions and Widths derivation!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Oct 09 4:45 PM
Not sure I quite follow you. Are you trying to read the current Width? Or are you asking for ways to figure out a width based on the Data (or Caption)?

If you want to read existing grids properties, this would be it:

For i = 0 to DataGrid.Columns.Count
Set col = DataGrid.Columns.Item(i)
msgbox col.FieldName & " - " & col.Width & " - " & col.Caption & " - " & col.ReadOnly
Next

If you run it through a Debugger, you could add the column variable to a Watch and then take a peek at all the properties on it.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: List Views Manipulation (again!): Captions and Widths derivation!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Oct 09 9:35 AM
sorry.

I'm talking F8 ListViews/Groups, not data grids. I'm trying to create a datagrid with the correct column widths for an existing Group. Either from the data, or the listview/GroupsPane object itself.

My guess is to read a few rows and get the max length for any text columns (some kind of autowidth function).....numbers and dates I can figure out from the recordset field type.
[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 4:34:43 PM