Aggregates demo not working with .NET 6

Hi,


I don't know what has changed recently but Aggregates stopped working with .NET6 & VS2022 for me. I copied the example below from the demos and tested it with .NET5 & VS2019 and .NET6 & VS2022.


@using Syncfusion.Blazor.Grids



<SfGrid DataSource="@Orders" AllowPaging="true">
    <GridPageSettings PageSize="8"></GridPageSettings>
    <GridAggregates>
        <GridAggregate>
            <GridAggregateColumns>
                <GridAggregateColumn Field=@nameof(Order.Freight) Type="AggregateType.Sum" Format="C2">
                    <FooterTemplate>
                        @{
                            var aggregate = (context as AggregateTemplateContext);
                            <div>
                                <p>Sum: @aggregate.Sum</p>
                            </div>
                        }
                    </FooterTemplate>
                </GridAggregateColumn>
            </GridAggregateColumns>
        </GridAggregate>
        <GridAggregate>
            <GridAggregateColumns>
                <GridAggregateColumn Field=@nameof(Order.Freight) Type="AggregateType.Average" Format="C2">
                    <FooterTemplate>
                        @{
                            var aggregate = (context as AggregateTemplateContext);
                            <div>
                                <p>Average: @aggregate.Average</p>
                            </div>
                        }
                    </FooterTemplate>
                </GridAggregateColumn>
            </GridAggregateColumns>
        </GridAggregate>
    </GridAggregates>
    <GridColumns>
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>
        <GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
    </GridColumns>
</SfGrid>


@code{
    public List<Order> Orders { get; set; }


    protected override void OnInitialized()
    {
        Orders = Enumerable.Range(1, 75).Select(x => new Order()
        {
            OrderID = 1000 + x,
            CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
            Freight = 2.1 * x,
            OrderDate = DateTime.Now.AddDays(-x),
        }).ToList();
    }


    public class Order
    {
        public int? OrderID { get; set; }
        public string CustomerID { get; set; }
        public DateTime? OrderDate { get; set; }
        public double? Freight { get; set; }
    }
}


    It's working fine with .NET5 but not with .NET6. This is what I see in a .NET6 project.


    If I comment out the aggregates, then the grid is displayed with data.



    With .NET5, no problem at all.



    Is it me doing something wrong?


4 Replies

MS Monisha Saravanan Syncfusion Team June 21, 2022 09:10 AM UTC

Hi Adem,


Greetings from Syncfusion support.


Query: “I don't know what has changed recently but Aggregates stopped working with .NET6 & VS2022 for me. I copied the example below from the demos and tested it with .NET5 & VS2019 and .NET6 & VS2022.”


We have checked your query and prepared an sample (.Net6) with the provided code snippet. But we could not able to reproduce the reported issue at our end. Kindly check the attached sample for your reference.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorApp11599941030.zip


Also we would like to inform that we have included breaking changes in loading scripts and styles in our latest version and javascript isolation is marked as obsolete from our version(20.1.0.47). So we suggest you to use any one of the below method to load styles and scripts externally for better performance.



  1. CDN
Scripts- https://blazor.syncfusion.com/documentation/common/adding-script-references#cdn-reference
Styles - https://blazor.syncfusion.com/documentation/appearance/themes#cdn-reference

 

  1. Static Web Assets

Scripts - https://blazor.syncfusion.com/documentation/common/adding-script-references#static-web-assets

 

Styles - https://www.nuget.org/packages/Syncfusion.Blazor.Themes/


Also refer the below release notes for your additional information.


Reference: https://blazor.syncfusion.com/documentation/release-notes/20.1.47?type=all#common


Example code snippet:

[layout.cshtml]/[Host.cshtml]

 

<link rel='nofollow' href=https://cdn.syncfusion.com/blazor/20.1.60/styles/bootstrap5.css rel="stylesheet"/>

      <script src=https://cdn.syncfusion.com/blazor/20.1.60/syncfusion-blazor.min.js type="text/javascript"></script>

    


Note:  Need to disable javascript isolation while using the above ways( AddSyncfusionBlazor()).


If the reported issue still persist then kindly get back to us with below details to validate further at our end.


  1. Share us the video demonstration of the issue explaining your query.
  2. If possible share us the issue reproduceable sample or try to reproduce the issue on the above mentioned sample.


The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.


Regards,

Monisha




AS Adem Sahin replied to Monisha Saravanan June 23, 2022 02:23 PM UTC

Hi Monisha,


Thanks for your response. I have also tried your sample but no luck unfortunately. Somehow it's related to Aggregate.Sum and Average because it's working fine if I make it Custom. I have nothing new to reproduce the issue on your side. I gave up anyway.



MS Monisha Saravanan Syncfusion Team June 24, 2022 02:12 PM UTC

Hi Adem,


Sorry for the inconvenience caused.


We could not able to reproduce the reported issue at our end. But we are facing similar issue with Grid aggregates on random scenarios. We have considered this as an bug and we will fix this issue internally and it will be included on our Volume 2, 2022 release which is expected to be rolled out on or before end of June. We will update you once the release is rolled out.


Until then we appreciate your patience.


Regards,

Monisha



MS Monisha Saravanan Syncfusion Team July 5, 2022 05:31 AM UTC

Hi Adem,


Thanks for the patience.


We are glad to announce that our Essential Studio 2022 Volume 2 release v20.2.0.36 is rolled out and we have included fix related to the issue “Grid does not rendered properly when using Aggregates” in our release. So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue and kindly get back to us if you still face any difficulties.


https://www.syncfusion.com/forums/175975/essential-studio-2022-volume-2-main-release-v20-2-0-36-is-available-for-download


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,          

Monisha


Loader.
Up arrow icon