Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, July 1, 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!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Datagrid column formatting
Jeffrey Johnson
Posts: 69
 
Datagrid column formattingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Nov 09 9:57 AM
I have a form with a datagrid. Every column in the datagrid in databound. The first column is an encoded ID field. The column name is Date. What I want to do is after the column or row has been databound, I want to convert the 0th column to an acutal date from our encoded ID.

Iam in the middle of exploring the idea of converting the column to a Custom Format column, data bound to the ID field then write a code snipet under 'Format Code'

is this the best way?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Datagrid column formattingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 09 12:22 AM
This should get you most of what you need: http://customerfx.com/pages/crmdeveloper/2008/09/11/Custom-Format-Columns-in-SalesLogix-Web-and-Linking-to-External-Sites-in-a-DataGrid.aspx

Also, the using a custom column is a valid route to take as well.
[Reply][Quote]
Jeffrey Johnson
Posts: 69
 
Re: Datagrid column formattingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 09 8:49 AM
This helped alot, thanks Ryan.
[Reply][Quote]
Jeffrey Johnson
Posts: 69
 
Re: Datagrid column formattingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 09 12:04 PM
so i wrote a snippet for the custom column, like your article shows....

but i get a 'object reference not set to an instance of an object' error with this code...

protected string ConvertBlastIDToDate(object name)
{
string strID = (string)name;
strID = strID.Substring(strID.Length - 12);
FormatProvider TimeFormat = new Globalization.CultureInfo("");
DateTime dt = DateTime.ParseExact(strID, "yyMMddHHmmss", TimeFormat);
}

im sure the error is caused from the (string) cast...
what is object really? is it the column class? is it the data that will be bound to the column ?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Datagrid column formattingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 09 12:38 PM
Using it as a string should be fine if your value is a string type. However, it might be a good idea to check for null as well

if (name != null)
{
//...
}

If you look at how it looks on a deployed smartpart it might make more sense. IIRC it takes the bound object (not a column object, but the property being bound) and just passes it to the method.
[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): 7/1/2025 6:19:50 PM