Footer aggregate not showing value

Hello,


I want to have a summary at the footer of the form. However, It does not show the desired outcome (please see the screenshot in the attachment.


@page "/GLEntry"

@using MyPersonal.Models

@using MyPersonal.Services

@inject IMyDBServices MyDBServices

<h3>GL Entry</h3>


<div class="col-lg-12 control-section">

    <div class="content-wrapper">

        <div class="row"></div>

        <SfGrid DataSource="@ListGL" ID="Grid" AllowTextWrap=true AllowExcelExport=true @ref="DefaultGrid" TValue="GL"

                Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update", "ExcelExport", "Search", "Print" })"

                AllowFiltering="true" AllowPaging="true" AllowSorting=true>

            <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>

            <GridEvents OnActionBegin="ActionBeginHandler" OnToolbarClick="ToolbarClickHandler" TValue="GL"></GridEvents>

            <GridPageSettings PageSize="10"></GridPageSettings>

            <GridColumns>

                <GridColumn Field="@nameof(GL.ID)" Width="35" IsPrimaryKey=true IsIdentity=true Visible=true></GridColumn>

                <GridColumn Field="@nameof(GL.EntryDate)" HeaderTextAlign="TextAlign.Center" HeaderText="GL Date" Width="40" EditType="EditType.DatePickerEdit" Format="dd-MMM-yy" DefaultValue=@dt TextAlign="TextAlign.Right"></GridColumn>

                <GridColumn Field="@nameof(GL.SubACCode)" Width="100" EditType="EditType.DefaultEdit" TextAlign="TextAlign.Left" HeaderText="Chart of Account">

                    @* <EditTemplate>

                  
<SfComboBox ID="SubAccount" TItem="Country" TValue="string" @bind-Value="@((context as Order).ShipCountry)" DataSource="@Countries">>

                    <ComboBoxFieldSettings  Value="CountryName" Text="CountryName"></ComboBoxFieldSettings>

                    </SfComboBox>

                    </EditTemplate>*@

                </GridColumn>


                <GridColumn Field="@nameof(GL.Currency)" HeaderText="Currency" Width="30" EditType="EditType.DropDownEdit" DefaultValue=@DefaultVal TextAlign="TextAlign.Center"></GridColumn>

                <GridColumn Field="@nameof(GL.Amt)" HeaderText="Amount" EditType="EditType.NumericEdit" TextAlign="TextAlign.Right" Width="35"></GridColumn>

@*                <GridColumn Field="@nameof(GL.Remark)" HeaderText="Remark" Width="100" EditType="EditType.DefaultEdit" TextAlign="TextAlign.Left"></GridColumn>

*@                <GridColumn Field="@nameof(GL.DateInsert)" Width="50" DefaultValue=@dt TextAlign="TextAlign.Right" Visible=false></GridColumn>

                <GridColumn Field="@nameof(GL.DateUpdate)" Width="50" DefaultValue=@dt TextAlign="TextAlign.Right" Visible=false Format="d"></GridColumn>

            </GridColumns>

            <GridSortSettings>

                <GridSortColumns>

                    <GridSortColumn Field="EntryDate" Direction="SortDirection.Descending"></GridSortColumn>

                </GridSortColumns>

            </GridSortSettings>

            <GridAggregates>

                <GridAggregate>

                    <GridAggregateColumns>

                        <GridAggregateColumn Field=@nameof(GL.Amt) Type="AggregateType.Sum" Format="C2">

                            <FooterTemplate>

                                @{

                                    var aggregate = (context as AggregateTemplateContext);

                                    <div>

                                        <p>Sum: @aggregate.Sum</p>

                                    </div>

                                }

                            </FooterTemplate>

                        </GridAggregateColumn>

                    </GridAggregateColumns>

                </GridAggregate>

              

            </GridAggregates>

        </SfGrid>

    </div>

</div>




Attachment: Reference_1a91f9c2.rar

1 Reply 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team June 20, 2022 09:40 AM UTC

Hi Sao,


Greetings from Syncfusion support.


We checked this scenario by creating a sample using your shared codes. But we could not reproduce the reported problem from our side. The footer template renders proper value in grid when using the shared codes. We are attaching a sample which we have tried for your reference. Please refer the screenshot below,


Kindly download and refer the attached sample. If you are still facing difficulties then the following details would be helpful for us to proceed further.


  1. Share a simple issue reproducing sample based on your scenario for us to validate.
  2. Share the exact scenario you are facing the reported problem.
  3. Share the Syncfusion version details.
  4. If possible reproduce the problem with the above attached sample and share with us for further analysis.


The provided information will help us analyze the problem, and provide you a solution as early as possible.


Regards,

Renjith R


Attachment: ServerApp_5e4e7c40.zip

Marked as answer
Loader.
Up arrow icon