Skip to content

Commit 6b315e6

Browse files
984045: Updated the UG content and samples for Aggregate section in DataGrid
1 parent 98fffbf commit 6b315e6

File tree

5 files changed

+13
-25
lines changed

5 files changed

+13
-25
lines changed

blazor/datagrid/aggregates.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ documentation: ug
1212

1313
The aggregates feature in the Syncfusion Blazor DataGrid displays summary values in the footer, group footer, and group caption. It enables computing summary information for specific columns and presenting it at key locations in the DataGrid. Configure aggregates with the GridAggregates component. For each aggregate column, specify at least the [Field](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_Field) and [Type](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_Type) properties.
1414

15-
For customized rendering, use aggregate templates and access values via AggregateTemplateContext (for example, Sum, Average, Min, Max, Count, TrueCount, and FalseCount). See: [AggregateTemplateContext](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.AggregateTemplateContext.html) and [AggregateType](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.AggregateType.html).
15+
For customized rendering, use aggregate templates and access values via AggregateTemplateContext (for example, **Sum, Average, Min, Max, Count, TrueCount**, and **FalseCount**). See: [AggregateTemplateContext](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.AggregateTemplateContext.html) and [AggregateType](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.AggregateType.html).
1616

1717
**Displaying aggregate values**
1818

@@ -139,15 +139,13 @@ The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid provides se
139139

140140
The available built-in aggregate types are :
141141

142-
* Sum: Calculates the sum of values in the column.
143-
* Average: Calculates the average of values in the column.
144-
* Min: Finds the minimum value in the column.
145-
* Max: Finds the maximum value in the column.
146-
* Count: Counts the number of values in the column.
147-
* TrueCount: Counts the number of true values in the column.
148-
* FalseCount: Counts the number of false values in the column.
149-
150-
The following example demonstrates built-in aggregate types with footer templates. Access aggregate values through AggregateTemplateContext using the matching type property (for example, Max, Min, TrueCount):
142+
* **Sum**: Calculates the sum of values in the column.
143+
* **Average**: Calculates the average of values in the column.
144+
* **Min**: Finds the minimum value in the column.
145+
* **Max**: Finds the maximum value in the column.
146+
* **Count**: Counts the number of values in the column.
147+
* **TrueCount**: Counts the number of true values in the column.
148+
* **FalseCount**: Counts the number of false values in the column.
151149

152150
{% tabs %}
153151
{% highlight razor tabtitle="Index.razor" %}

blazor/datagrid/custom-aggregate.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ The custom aggregate function is invoked differently based on the context:
1919
- **Total Aggregation:** The function receives the entire dataset and the current aggregate column object.
2020
- **Group Aggregation:** The function receives the current group details and the aggregate column object.
2121

22-
Here’s an example that demonstrates how to use the custom aggregate feature in the DataGrid:
23-
2422
{% tabs %}
2523
{% highlight razor tabtitle="Index.razor" %}
2624
@using Syncfusion.Blazor.Grids
@@ -110,13 +108,11 @@ Here’s an example that demonstrates how to use the custom aggregate feature in
110108

111109
{% previewsample "https://blazorplayground.syncfusion.com/embed/VZVIXkVRertPQOeX?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
112110

113-
> To access a custom aggregate value inside a template, use the `Custom` key (AggregateTemplateContext.Custom).
111+
> To access a custom aggregate value inside a template, use the **Custom** key (**AggregateTemplateContext.Custom**).
114112
115113
**Show the count of distinct values in aggregate row**
116114

117-
Custom aggregate functions can also compute distinct counts or other domain-specific summaries. Specify the [Type](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_Type) as Custom and provide a function via the [CustomAggregate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_CustomAggregate) property. The result can be rendered in the footer, group footer, or group caption by using the corresponding template and accessing AggregateTemplateContext.Custom.
118-
119-
Here’s an example that shows the count of distinct values for the ShipCountry column using a custom aggregate:
115+
Custom aggregate functions can also compute distinct counts or other domain-specific summaries. Specify the [Type](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_Type) as Custom and provide a function via the [CustomAggregate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_CustomAggregate) property. The result can be rendered in the footer, group footer, or group caption by using the corresponding template and accessing **AggregateTemplateContext.Custom**.
120116

121117
{% tabs %}
122118
{% highlight razor tabtitle="Index.razor" %}

blazor/datagrid/footer-aggregate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ documentation: ug
1111

1212
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid supports calculating and displaying aggregate values in footer cells. Footer aggregates summarize column values across rows and render in the DataGrid footer. Use the [FooterTemplate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_FooterTemplate) property to render aggregate values in footer cells.
1313

14-
Access aggregate values inside `FooterTemplate` through the implicit template parameter `context`. Cast `context` to [AggregateTemplateContext](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.AggregateTemplateContext.html) to read properties such as Sum, Average, Min, Max, Count, TrueCount, and FalseCount.
14+
Access aggregate values inside `FooterTemplate` through the implicit template parameter **context**. Cast **context** to [AggregateTemplateContext](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.AggregateTemplateContext.html) to read properties such as **Sum, Average, Min, Max, Count, TrueCount,** and **FalseCount**.
1515

1616
{% tabs %}
1717
{% highlight razor tabtitle="Index.razor" %}

blazor/datagrid/group-and-caption-aggregate.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ documentation: ug
1111

1212
Group footer and group caption aggregates in the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid calculate values based on items in each group and display results in group footer cells and group caption cells. Configure these using the [GroupFooterTemplate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_GroupFooterTemplate) and [GroupCaptionTemplate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_GroupCaptionTemplate) properties of the [GridAggregateColumn](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn__ctor) component. Aggregate values inside templates can be accessed through AggregateTemplateContext (for example, Sum, Min, Max).
1313

14-
> For group aggregates, ensure grouping is enabled at the grid level with AllowGrouping set to true, and maintain grouped columns by setting [ShowGroupedColumn](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridGroupSettings.html#Syncfusion_Blazor_Grids_GridGroupSettings_ShowGroupedColumn) to true.
14+
> For group aggregates, ensure grouping is enabled at the grid level with [AllowGrouping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_AllowGrouping) set to **true**, and maintain grouped columns by setting [ShowGroupedColumn](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridGroupSettings.html#Syncfusion_Blazor_Grids_GridGroupSettings_ShowGroupedColumn) to **true**.
1515
1616
## Group footer aggregates
1717

1818
Group footer aggregates appear in the footer cells of each group and provide per-group summary values. To display group footer aggregates, define a template with the [GroupFooterTemplate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_GroupFooterTemplate) property. The template renders the aggregate value for each group’s footer row. Apply the Format property to present currency or date values using culture-aware formatting as needed.
1919

20-
The following example demonstrates group footer aggregates in the DataGrid:
21-
2220
{% tabs %}
2321
{% highlight razor tabtitle="Index.razor" %}
2422
@using Syncfusion.Blazor.Grids
@@ -110,14 +108,12 @@ The following example demonstrates group footer aggregates in the DataGrid:
110108
{% endhighlight %}
111109
{% endtabs %}
112110

113-
{% previewsample "https://blazorplayground.syncfusion.com/embed/LDhKCXUDfMsXaMrj?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
111+
{% previewsample "https://blazorplayground.syncfusion.com/embed/VDheZEVxysGhsjjP?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
114112

115113
## Group caption aggregates
116114

117115
Group caption aggregates appear in the caption cells at the top of each group and provide a concise summary. To display group caption aggregates, define a template using the [GroupCaptionTemplate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridAggregateColumn.html#Syncfusion_Blazor_Grids_GridAggregateColumn_GroupCaptionTemplate) property. The template renders the aggregate value in the caption area of each group. Apply the Format property to aggregate values to present culture-aware currency or date results.
118116

119-
The following example demonstrates group caption aggregates in the DataGrid:
120-
121117
{% tabs %}
122118
{% highlight razor tabtitle="Index.razor" %}
123119
@using Syncfusion.Blazor.Grids

blazor/datagrid/reactive-aggregate.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid supports re
1515

1616
When the DataGrid is in batch editing mode, aggregate values in the footer, group footer, and group caption are refreshed each time a cell edit is saved. This ensures that summaries reflect the most recent edits.
1717

18-
The following example demonstrates automatic aggregate value updates in batch editing:
19-
2018
{% tabs %}
2119
{% highlight razor tabtitle="Index.razor" %}
2220
@using Syncfusion.Blazor.Grids

0 commit comments

Comments
 (0)