Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > How to format a date column in a Grid web part? View modes: 
User avatar
Member
Member
tripletdad99 - 8/30/2009 8:27:51 AM
   
How to format a date column in a Grid web part?
How do you go about formating a date column in a Grid web part?

I only want to show the date - not the time (such as "{0:d}" )


User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 9/1/2009 12:55:53 AM
   
RE:How to format a date column in a Grid web part?
Hi,

Unfortunately, there is no native support for this request. However, you can modify ~\CMSWebParts\Viewers\cmsdatagrid.ascx.cs gridElem_ItemDataBound method for this purpose. In this method you can check if the current item is of type datetime and if this would be the case, you can simply modify it according your needs.

Best Regards,
Miroslav Remias.