adding an aggregate column in the detail grid thrown an error

Hello,

I am trying to add an aggregate column in the detail grid. The following error is thrown:

The child content element 'FooterTemplate' of component 'GridAggregateColumn' uses the same parameter name ('context') as enclosing child content element 'DetailTemplate' of component 'GridTemplates'. Specify the parameter name like: '<FooterTemplate Context="another_name"> to resolve the ambiguity.



Please help

Sao




1 Reply

SP Sarveswaran Palani Syncfusion Team September 21, 2022 05:33 PM UTC

Hi Sao,


Greetings from Syncfusion support.


We have analyzed you query and suggest you to share parent grid records to detail template by context parameter. Because the detail template is a rendered fragment , arguments are passed by context. 

So kindly refer the code snippet and give common context menu to the second child.


Kindly refer the attached code snippet and links for your reference.


<DetailTemplate>

        <h2>Order list of selected emplyee</h2>

        @{

            var employee = (context as EmployeeData);

            <SfGrid TValue="Order" Query="@GetEmployeesQuery(employee)" AllowSorting=true AllowFiltering="true" AllowPaging="true" AllowGrouping="true"

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

                ContextMenuItems="@(new List<object>() { "AutoFit", "AutoFitAll", "SortAscending", "SortDescending","Copy", "Edit", "Delete", "Save", "Cancel","PdfExport", "ExcelExport", "CsvExport", "FirstPage", "PrevPage","LastPage", "NextPage"})">

                .

                .

                <GridTemplates>

                    <DetailTemplate Context="CustomerContext">

                        @{

                            var orders = (CustomerContext as Order);

                            <SfGrid TValue="CustomerDetails" Query="@GetOrderQuery(orders)">

                                <SfDataManager Url=https://js.syncfusion.com/demos/ejservices/Wcf/Northwind.svc/Customers CrossDomain="true"></SfDataManager>

                                <GridColumns>

                                    <GridColumn Field=@nameof(CustomerDetails.CustomerID) HeaderText="Customer ID" Width="110"></GridColumn>

                                    .

                                    .

                                </GridColumns>

                            </SfGrid>

                        }

                    </DetailTemplate>

   </DetailTemplate>

}


Reference: https://blazor.syncfusion.com/demos/datagrid/hierarchy-grid?theme=fluent


Kindly get back to us if you have any further queries.


Regards,

Sarveswaran PK


Loader.
Up arrow icon