Search code examples
kendo-gridkendo-asp.net-mvc

How can i format the kendo grid group date


I am using below grouping in Kendo Grid.

.Group(groups => groups.AddDescending(p => p.TransactionMonth))

The month is coming in an ISO format like 2020-03-02T00:00:00. The same is displaying in the group header. Is it possible to convert this to show in MMMM yyyy format?


Solution

  • Found a solution for this. Added a GroupHeaderTemplate to the column bound as given below

    columns.Bound(t => t.TransactionMonth).Title("Transaction Month").Hidden(true).ClientGroupHeaderTemplate("#= kendo.toString(kendo.parseDate(value.split('T')[0]), 'MMMM yyyy') #");