- Home
- Forum
- ASP.NET Core - EJ 2
- formatting in aggregate row does not work
formatting in aggregate row does not work
3 Replies
VA
Venkatesh Ayothi Raman
Syncfusion Team
May 30, 2018 04:01 PM UTC
Hi Alex,
Thanks for using Syncfusion products.
We have tried to reproduce the reported issue but its unsuccessful. We have prepared a sample based on your requirement that can be download from following link,
In this sample, we have enabled the Aggregate row with formatting for Double value. Please refer to the following code example,
|
[Grid]
<ejs-grid id="Grid" dataSource="ViewBag.datasource" allowPaging="true">
. . .
<e-grid-aggregates>
<e-grid-aggregate>
<e-aggregate-columns>
<e-aggregate-column field="Freight" type="Sum" format="C2" footerTemplate="Sum:${Sum}"></e-aggregate-column>
</e-aggregate-columns>
</e-grid-aggregate>
</e-grid-aggregates>
. . .
<e-grid-columns>
. . .
</e-grid-columns>
</ejs-grid>
[Cs code]
public int? OrderID { get; set; }
. . .
public Double? Freight { get; set; }
. . . |
If you still face the same issue, then could you please share the following details?
1) Share the Aggregate code example and Grid code example.
2) Share the Issue screenshot.
3) Share the replication procedure to reproduce the issue.
4) Please modified the given sample as issue reproducible.
Regards,
Venkatesh Ayothiraman.
AL
Alex
June 1, 2018 09:57 AM UTC
Hi!
Attachment: aggregateFormat_80c48b83.zip
In my case, the first time the grid is initialized with an empty array, then for some event the grid gets data. I have modified your sample and attached it.
Thx!!!
Attachment: aggregateFormat_80c48b83.zip
VA
Venkatesh Ayothi Raman
Syncfusion Team
June 4, 2018 12:34 PM UTC
Hi Alex,
Thanks for the update.
We have found the column type using Grid cell values when we didn’t define the column’s type. As for aggregate columns, we have applied the format based on column type. In this case, you have initially bound the empty data source and didn’t define the column’s type. This is the cause of this issue and we suggest you define the column’s type property to resolve this issue like as follows,
|
...
var ej2_grid = new ej.grids.Grid({
dataSource:[],
allowGrouping: true,
groupSettings: { columns: ["ShipCountry"]},
columns: [. . .
{ field: "ShipCountry", headerText: "Ship Country", type:'string', width: "140" },
{ field: "Freight", headerText: "Freight", type:'number', textAlign: "Right", width: "160", format: "C2", }
],
aggregates: [
{ columns: [{ field: "Freight", format: "C2", groupCaptionTemplate: "${Sum}", type: "Sum" }] }
]
}); |
Help documentation: https://ej2.syncfusion.com/16.1.37/documentation/grid/api-column.html?lang=typescript#type
We have also modified the sample which can be download from following link,
Regards,
Venkatesh Ayothiraman.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
AL Alex
- May 29, 2018 08:33 PM UTC
- Jun 4, 2018 12:34 PM UTC