Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, May 18, 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 - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: Grid DateOnly Field Column Widths going Double Wide!
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Grid DateOnly Field Column Widths going Double Wide!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Feb 10 9:13 AM
Answer Is!

there is some 'Grid control magic' going on here for an mm/dd/yyyy date only display of a datetime field.
if a Date Column width is set to 68 or more, and a null date is encountered, then the width is greatly increased.
estimated size is about 115.
if the column width is set to 67 or less, then the date column width stays as specified!

Const GridDateWidth = 67 ' RJS 2/4/2010. was '68 ''' RJS 6/16/2009

BUG!

1. SQL 2005 Native Connection to fetch the data into an ADO recordset.
2. typical SQL: SELECT A1.DATEOPENED FROM OPPORTUNITY A1....
2. Fill/refresh the datagrid through the recordset (not using SQL.TEXt, not using SLX OLE DB Provider).
3. Typical Grid building statements for Dates:

Set col = .Columns.Add(3) '3=DateTime
col.FieldName = "ESTIMATEDCLOSE"
col.Caption = "Est. Close"
col.WIDTH = GridDateWidth
col.Alignment = dgAlignRight
col.FormatTYPE = 3
col.FormatString = "mm/dd/yyyy"
col.Visible = True
col.ReadOnly = True

Set col = .Columns.Add(3) '3=DateTime
col.FieldName = "ACTUALCLOSE"
col.Caption = "Actual Close"
col.WIDTH = GridDateWidth
col.Alignment = dgAlignRight
col.FormatTYPE = 3
col.FormatString = "mm/dd/yyyy"
col.Visible = True
col.ReadOnly = True


So far so good....everything works/looks great.

Unfortunately, if there is a NULL date in a column, then that Column's Width at run time is about 115 pixels (instead of 68).....

We still need to sort

(tried using SQL:

CONVERT(VARCHAR(10),A1.PERIOD_END,,101) as PERIOD_END

but varchar dates don't sort correctly.....doh).

It looks like Delphi is converting the null dates to 'blank' date times and expanding the grid to almost double the size....

any ideas for a workaround?

Thanks!
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Grid DateOnly Field Column Widths going Double Wide!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 10 8:21 AM
Answer may be.....

use "ddddd" for a format string, maybe Delphi doesn't recognize mm/dd/yyyy for null datetime values?

Anyway, setting width to 67 works just fine....
[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): 5/18/2024 11:36:20 PM