We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfDatagrid ArgumentNullException

SfDatagrid GridSummaryColumn  throws ArgumentNullException when the SfDatagrid have no rows to show.

XAML:

<syncfusion:SfDataGrid.TableSummaryRows>

                                    <syncfusion:GridTableSummaryRow Title="Total : {ItemCount}" ShowSummaryInRow="True">

                                        <syncfusion:GridSummaryRow.SummaryColumns>

                                            <syncfusion:GridSummaryColumn

                                                Name="ItemCount"

                                                Format="'{Count:d}'"

                                                MappingName="ID"

                                                SummaryType="CountAggregate" />

                                        </syncfusion:GridSummaryRow.SummaryColumns>

                                    </syncfusion:GridTableSummaryRow>

                                </syncfusion:SfDataGrid.TableSummaryRows>


2 Replies 1 reply marked as answer

DI Diyari February 6, 2023 06:25 PM UTC

I have fixed the issue.

The problem was that i was using IEnumerable as my itemsource. Now i changed to List and it's working fine.


The issue:

public IEnumerable <FullEmployeeModel>? Employees { get; set; }


Updated:

public List<FullEmployeeModel>? Employees { get; set; }


Marked as answer

VS Vijayarasan Sivanandham Syncfusion Team February 7, 2023 01:24 PM UTC

Hi Diyari,

We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help.

Regards,
Vijayarasan S


Loader.
Up arrow icon