Summary type Sum returning zero.

I have a grid which is displaying data fine and now I'm adding a summary row, but the summary row is coming out as zero. I've just applied globalisation to the site to get the correct currency symbol, it was working before I did that. I'm trying to total on the Balance value, which is Decimal in the viewmodel. 



Here's the grid CSHTML:

<div class="row">
    <div class="col-xs-12">
        <ej-grid accesskey="" id="OustandingTransactionGrid" show-summary="true"
                 [email protected]
                 allow-paging="true"
                 allow-scrolling="true"
                 allow-sorting="true"
                 is-responsive="true"
                 enable-responsive-row="true"
                 locale="@System.Globalization.CultureInfo.CurrentCulture.Name.ToString()"
                 allow-resize-to-fit="true">
            <e-summary-rows>
                <e-summary-row title="Outstanding Balance">
                    <e-summary-columns>
                        <e-summary-column summary-type="Sum" format="{0:C}" display-column="Type" data-member="Balance" />
                    </e-summary-columns>
                </e-summary-row>
            </e-summary-rows>
            <e-columns>
                <e-column field="TransactionDate" header-text="Date" text-align="Left" width=@("15%") format="{0:dd/MM/yyyy}" priority="1"></e-column>
                <e-column field="Type" header-text="Type" width=@("12%") priority="1"></e-column>
                <e-column field="Reference1" header-text="Reference 1" width=@("25%") priority="2"></e-column>
                <e-column field="Reference2" header-text="Reference 2" width=@("25%") priority="2"></e-column>
                <e-column field="Value" header-text="Value" text-align="Right" width=@("10%") format="{0:C2}" type="number" priority="2"></e-column>
                <e-column field="Balance" header-text="Balance" text-align="Right" width=@("10%") format="{0:C2}" type="number" priority="1"></e-column>
            </e-columns>
        </ej-grid>
    </div>

</div>

Thanks

3 Replies

VA Venkatesh Ayothi Raman Syncfusion Team April 20, 2017 09:59 AM UTC

Hi Alan, 
Thanks for contacting Syncfusion support. 
We went through your code example and found that you are declaring the dataMember property as data-member instead of datamember. This is the cause of the issue. So, we suggest you to change that property to datamember from data-member. Please find the code example, 
Code example
<ej-grid id="Grid" datasource="@ViewBag.dataSource" allow-paging="true" > 
. . . 
    <e-summary-rows> 
        <e-summary-row title="Outstanding Balance"> 
            <e-summary-columns> 
                <e-summary-column summary-type="Sum" format="{0:C}" display-column="Freight" datamember="Freight" /> 
            </e-summary-columns> 
        </e-summary-row> 
    </e-summary-rows> 
    <e-columns> 
. . . 
        </e-column> 
         
 
    </e-columns> 
</ej-grid> 

Regards, 
Venkatesh Ayothiraman. 



AB Alan Bourke April 20, 2017 10:08 AM UTC

Thanks Venkatesh, that has fixed it.

You probably need to fix your documentation here.




VA Venkatesh Ayothi Raman Syncfusion Team April 21, 2017 08:53 AM UTC

Hi Alan, 
Thanks for the update. 
We have already fixed that documentation and it will be live on our upcoming Volume 2 release which is expected to be rolled out at end of April,2017.  
Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon