Formatting DateTime in the Column Total Header

2 posts, 0 answers
  1. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 27 Aug 2015 Link to this post


    I am using 2015.1.401.40 of your ASP.NET controls for AJAX.

    One of my PivotGridColumnField's is a smalldatetime field from SQL Server.

    In the PivotGrid column header labels I want the dates to be formatted as MMM-yy,  like Aug-15.

    I can accomplish that for the detail columns (the non-aggregate columns) by setting the DataFormatString="{0:MMM-yy}"

    But that doesn't affect the label of the column total header.  That header label reads:  "08/01/2015 00:00:00 Total"

    Again, my goal is to have it read:  Aug-15 Total

    How can I accomplish this?  I can't believe there isn't a property to control it...

    I've seen a couple of suggestions where people were told they should change the header text in the CellDataBound Event, but the problem is that in this event I don't seem to have access to the date value.  I have only seen that I can read the current header text which again is a string of a date and the word "Total".

    I don't want to strip the word "Total" out of that string and then then convert the date that remains to a string in the date format I want.  We do localization here so I would imagine that if my culture was something other than English, the word "Total" would be translated into another language.

    If there isn't a neat and clean way to do this, it seems like a big oversight (missing functionality) on the part of the pivotgrid.



  2. Angel Petrov
    Angel Petrov avatar
    1003 posts

    Posted 01 Sep 2015 Link to this post

    Hello Brent,

    I am sorry but with the current implementation one should parse the string and modify it according to the requirements. If exposing a custom format options is mandatory for your project you can log a feature request in our feedback portal. That way our developers will examine the matter and if possible improve the control functionality for a future release.

    Angel Petrov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top