Programmatically setting Summary on a dxDataGrid

0
0

Hi guys.

I need to set a dxDataGrid Summary programmatically but haven’t quite found out how. When doing it in the Options Property Editor, it works fine.
This is what I set in the Editor and it works:


    "summary": {
        "totalItems": [{
            "column": "myColumn",
            "summaryType": "count"
        }],
        "groupItems": [{
            "column": "myColumn",
            "summaryType": "count"
        }]
    },

But then, I need to set it at run time, and this is what I have tried and it doesn’t work:


    this.dxDataGrid1.Options.summary = new
    {
        totalItems = new object[] {
            new
            {
                column = "myColumn",
                summaryType = "count"
            }
        },
        groupItems = new object[] {
            new
            {
                column = "myColumn",
                summaryType = "count"
            }
        }
    };

Any tips on what else I could try?

Thanks in advance.

Ivan
(Wisej 2.2.52.0 – VS 2019 – C#)

  • You must to post comments
0
0

Never mind, got it working. It was just that the timing was wrong.
By the way, the coding I was using was right.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.