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!
|
|
Datagrid Column Formating
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????"
|
|
|
|
Re: Datagrid Column Formating
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
|
|
|
|
Re: Datagrid Column Formating
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
|
|
|
|
Re: Datagrid Column Formating
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? |
|
|
|
Re: Datagrid Column Formating
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
|
|
|
|
Re: Datagrid Column Formating
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?
|
|
|
|
Re: Datagrid Column Formating
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! |
|
|
| |
|