Forums

Forums / Developing Portals / Formatting datetime field columns on the Grid Control

Formatting datetime field columns on the Grid Control

Thread is closed for posting
2 posts, 1 answered
  1. Yassin Khan
    Yassin Khan avatar
    5 posts
    Registered:
    01 Nov 2018
    14 Dec 2018
    Link to this post
         Hi,

      How do I go about formatting the date time field columns on the grid widget?

       Thanks
  2. Josh
    Josh avatar
    47 posts
    Registered:
    01 Jun 2018
    Answered
    29 Oct 2019 in reply to Yassin Khan
    Link to this post

    Hello Yassin,

    To apply custom formatting for a DateTime column in the TPC Grid widget, you must first select Edit on the TPC Grid Widget. Under Edit, you will navigate to Columns, and then select Edit on the column you would like to format.

    Edit (Grid) -> Columns -> {Date Column} -> Edit

    You will notice a field called Format HTML, which should have a default value of {0}. This is where you can apply your DateTime formatting. This property will apply standard .NET DateTime formatting with the format string that you provide. For example, you could change the property to {0:MM/dd/yyyy}, and your dates will be in the format MM/dd/yyyy.

    More information on .NET DateTime Format Strings can be found here: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings.

    More information on formatting DateTime columns in a TPC Grid can be found in this official blog post under the section titled Grid Date Formatting: https://www.crmportalconnector.com/blog/portal-hero-blog/2018/08/23/portal-connector-secrets-part-1.

    If you have any other questions please feel free to reply to this thread, or for more complex issues you can email support@crmportalconnector.com.

    Cheers,

    Josh

2 posts, 1 answered