Hi Johan,
Greetings from Syncfusion support.
We have prepared a consolidated sample based on the below three queries for your convenience, please download the sample from the link below,
Query 1 : - How to add a 'calculated column' to a datagrid.
We suggest you to use ColumnTemplate feature of Grid. With this you can display a customized column in Grid.
In the below code, we have calculated difference between A and B column, and display in 3rd column. Please refer the codes below,
<GridColumn Field=@nameof(Order.A) HeaderText="A" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.B) HeaderText="B" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn HeaderText="Diff of A&B" Format="C2" TextAlign="TextAlign.Right" Width="120">
<Template>
@{
var a = context as Order;
var Difference = a.A - a.B;
}
<span>@Difference</span>
</Template>
</GridColumn>
|
Query 2 : How to filter on a date (without time), while the column type is DateTime (including time).
We suggest you to refer the below documentation for more details regarding filtering columns in grid. In the above attached sample we have performed filtering for a DateTime(values including time) column.
Query 3 : - How to add summaries of columns under a filtered grid.
We suggest you to refer the below documentation for more details regarding aggregate columns in Grid. In the above attached sample we have added summary to the OrderDate column.
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran