Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 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: Datagrid Column Formating
Mike Mahoney
Posts: 34
 
Datagrid Column FormatingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jul 06 6:35 PM
fiogf49gjkf0d
Hi Everyone,

I'm building a data grid at run time. An example of that is below.

For the postal code and phone fields, I need formatting. How do I format a phone or postal code field using the FormatString Property?

with dgResults
.SQL = strSQL
With .Columns
'remove any existing columns
If (.Count > 0) Then
For x = 0 To .Count - 1
.Item(0).Delete
Next
End If

'Phone Number
Set col = .Add(0)
col.FieldName = "MAINPHONE"
col.Caption = "Phone"
col.ReadOnly = True
col.MaxLength = 32
col.Width = 85
'col.FormatString = "?What do you put in here????"
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Datagrid Column FormatingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Jul 06 7:51 AM
fiogf49gjkf0d
Try something like this...

If Right(LCase(fld.Name),5) = "phone" Then
col.Width = 400
col.FormatType = 7
end if
[Reply][Quote]
Darrell
Posts: 4
 
Re: Datagrid Column FormatingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 06 10:04 AM
fiogf49gjkf0d
How do I add a picklist at runtime? I reviewed the article "Creating DataGrid Columns at Runtime"
but when I use "col.picklistname" it errors as picklistname is not a member of col

Thanks for any input
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Datagrid Column FormatingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 06 10:40 AM
fiogf49gjkf0d
A picklist is merely a UI object that assists in the entry of informaiton into a field in the database not a field in the database. You need to use the name of a field from the table. Does this make sense?
[Reply][Quote]
Darrell
Posts: 4
 
Re: Datagrid Column FormatingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 06 11:10 AM
fiogf49gjkf0d
Could you please explain?

Here is my code:

Set col = grdoppContact.Columns.Add(15)
col.FieldName = "SalesRole"
col.Caption = "Status"
col.Width =43

How do I tell it which picklist to use?
or if I set it to a combo box, how do I load available values?

thanks

[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Datagrid Column FormatingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 06 11:20 AM
fiogf49gjkf0d
I am not following what you are trying to do. Can you explain:

- were the grid is going to appear in the SalesLogix UI? It looks like a contact tab but I can't be sure.

- what fields from what tables you want to appear in your grid?

- what you want to do with the data in the grid once it is populated?

[Reply][Quote]
Darrell
Posts: 4
 
Re: Datagrid Column FormatingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 06 11:24 AM
fiogf49gjkf0d
I solved the problem!

'Status
Set col = grdoppContact.Columns.Add(15)
col.FieldName = "SalesRole"
col.Caption = "Status"
col.Width =43
col.picklistname="role"

I was getting an error on the col.picklistname until
I changed the add from add(0) to add(15)

Thanks for your help!
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Datagrid Column FormatingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jul 06 12:32 PM
fiogf49gjkf0d
Now I see what you are trying to do. Sorry it did not sink in before.
[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): 11/22/2024 3:20:40 PM