Group by date

11 Feb 20191 minute to read


This feature is applicable for Relational datasource alone (in Client Mode).

Allows the user to categorize the date type field and showcase them based on year, quarter, month and day formats.

  • HTML
  • <ej:PivotGrid ID="PivotGrid1" EnableGroupingBar="true" runat="server" ClientIDMode="Static">
                <ej:Field FieldName="Date" FieldCaption="Date" Format="date" FotmatString: "yyy-MM-dd" Delimiter="-"></ej:Field>

    The type of date fields are given in the GettingStarted.aspx.cs as shown in the below snippet.

  • C#
  • protected void Page_Load(object sender, EventArgs e)
        this.PivotGrid1.Model.DataSource.Columns[0].GroupByDate.Interval = new List<string>() { "yyyy", "qqq", "MMMM", "dd-MMM" };

    The properties associated with group by date option is,

    • Format - To set the data type format.
    • FormatString - Specifies the structure of the date format.
    • Delimiter - Specifies the separator of the date values.
    • GroupByDate.Interval - Specifies the pattern in which date type to be displayed.

    Group by date support in ASP NET pivot grid control