menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TreeGridAggregateColumn - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TreeGridAggregateColumn

    Configures Tree Grid aggregate column.

    Inheritance
    System.Object
    TreeGridAggregateColumn
    Namespace: Syncfusion.Blazor.TreeGrid
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class TreeGridAggregateColumn : OwningComponentBase

    Constructors

    TreeGridAggregateColumn()

    Declaration
    public TreeGridAggregateColumn()

    Properties

    ColumnName

    Defines the column name to display the aggregate value. If ColumnName is not defined, then field name value will be assigned to the columnName property.

    Declaration
    public string ColumnName { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the column name for aggregate display.

    Examples
    <SfTreeGrid DataSource="@TreeGridData" IdMapping="TaskId" ParentIdMapping="ParentId">
        <TreeGridAggregates>
            <TreeGridAggregate>
                <TreeGridAggregateColumns>
                    <TreeGridAggregateColumn ColumnName="Total" Field="Sales" Type="Sum"></TreeGridAggregateColumn>
                </TreeGridAggregateColumns>
            </TreeGridAggregate>
        </TreeGridAggregates>
    </SfTreeGrid>

    Field

    Gets or sets the name of the column on which the aggregate function will be performed.

    Declaration
    public string Field { get; set; }
    Property Value
    Type Description
    System.String

    A System.String that specifies the column name to be used for displaying aggregate results.

    Examples
    <SfTreeGrid DataSource="@TreeGridData" IdMapping="TaskId" ParentIdMapping="ParentId">
        <TreeGridAggregates>
            <TreeGridAggregate>
                <TreeGridAggregateColumns>
                    <TreeGridAggregateColumn ColumnName="Total" Field="Sales" Type="Sum"></TreeGridAggregateColumn>
                </TreeGridAggregateColumns>
            </TreeGridAggregate>
        </TreeGridAggregates>
    </SfTreeGrid>

    FooterTemplate

    Defines the footer cell template as a string for the aggregate column. The Type name should be used to access aggregate values inside the template.

    Declaration
    public RenderFragment<object> FooterTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment<System.Object>

    A Microsoft.AspNetCore.Components.RenderFragment representing the footer template with a generic type parameter.

    Examples
    <SfTreeGrid DataSource="@TreeGridData" IdMapping="TaskId" ParentIdMapping="ParentId">
        <TreeGridAggregates>
            <TreeGridAggregate>
                <TreeGridAggregateColumns>
                    <TreeGridAggregateColumn Field="Sales" Type="Sum" Format="C2">
                    <FooterTemplate>
                      @{
                         var sumvalue = (context as Syncfusion.Blazor.Grids.AggregateTemplateContext);
                            <div>
                                <p>Sum: @sumvalue.Sum</p>
                            </div>
                        }
                    </FooterTemplate>
                    </TreeGridAggregateColumn>
                </TreeGridAggregateColumns>
            </TreeGridAggregate>
        </TreeGridAggregates>
    </SfTreeGrid>

    Format

    Format is applied to a calculated value before it is displayed. Gets the format from the user, which can be standard or custom.

    Declaration
    public string Format { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the format to apply.

    Examples
    <SfTreeGrid DataSource="@TreeGridData" IdMapping="TaskId" ParentIdMapping="ParentId">
        <TreeGridAggregates>
            <TreeGridAggregate>
                <TreeGridAggregateColumns>
                    <TreeGridAggregateColumn Field="Sales" Type="Sum" Format="C2"></TreeGridAggregateColumn>
                </TreeGridAggregateColumns>
            </TreeGridAggregate>
        </TreeGridAggregates>
    </SfTreeGrid>

    Type

    Defines the aggregate type of a particular column.
    Types of aggregate supported in-built are,
    Sum - Performs sum aggregation.
    Average - Performs average aggregation.
    Count - Performs count aggregation. FalseCount - Performs false count aggregation.
    TrueCount - Performs true count aggregation.
    Max - Performs max aggregation.
    Min - Performs min aggregation.

    Declaration
    public object Type { get; set; }
    Property Value
    Type
    System.Object
    Examples
    <SfTreeGrid DataSource="@TreeGridData" IdMapping="TaskId" ParentIdMapping="ParentId">
        <TreeGridAggregates>
            <TreeGridAggregate>
                <TreeGridAggregateColumns>
                    <TreeGridAggregateColumn Field="Sales" Type="Sum"></TreeGridAggregateColumn>
                </TreeGridAggregateColumns>
            </TreeGridAggregate>
        </TreeGridAggregates>
    </SfTreeGrid>

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    OnInitializedAsync()

    Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. Override this method if you will perform an asynchronous operation and want the component to refresh when that operation is completed.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    OnParametersSetAsync()

    Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    Back to top Generated by DocFX
    OSZAR »
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved
    OSZAR »