Datetime format in PivotGrid or Pivot Engine

Posted by: hmjagadeesh26 on 23 January 2019, 12:16 am EST

  • Posted 23 January 2019, 12:16 am EST

    Hai,

    How to change datetime format while using Pivot grid or pivot engine, as i am able to change in Flexgrid.

    Thank you in advance

  • Posted 23 January 2019, 11:39 pm EST

    Hello,

    You may set the PivotField format while creating the PivotEngine.

    Please refer to the following code snippet for reference:

    @(Html.C1().PivotEngine().Id("PivotEngine").Bind(Model).Fields(
            field => {
                field.Items(item =>
                {
                    item.AddPivotField(fb => fb.Header("Country").Binding("Country"));
                    item.AddPivotField(fb => fb.Header("Product").Binding("Product"));
                    item.AddPivotField(fb => fb.Header("Color").Binding("Color"));
                    item.AddPivotField(fb => fb.Header("Amount").Binding("Amount"));
                    item.AddPivotField(fb => fb.Header("Start").Binding("Start").Format("MMM, yyyy"));
                    item.AddPivotField(fb => fb.Header("End").Binding("End").Format("MMM, yyyy"));
                });
            }
        ))
    

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels