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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

sfDataGRid Group

Thread ID:





125365 Aug 10,2016 11:18 PM UTC Aug 17,2016 10:54 AM UTC Xamarin.Forms 5
Tags: SfDataGrid
Miguel Arenas
Asked On August 10, 2016 11:18 PM UTC

can this control create groups and summary of a one or more columns ?

Divakar Subramaniam [Syncfusion]
Replied On August 11, 2016 09:29 AM UTC

 Hi Miguel,

Thank you for using Syncfusion Products.

SfDataGrid supports single column grouping in which you can group any column by adding the Group Description with “column name” to the GroupColumnDescription collection. You can refer the below UG link for know more about grouping in SfDataGrid.

Caption summary row will be created whenever you group a column in SfDataGrid. You can also customize the caption text in SfDataGrid. Refer the below UG link for more details regarding summary in SfDataGrid. 

Currently we do not have support for multi-grouping in SfDataGrid and have considered your request to be a feature. We have added it to our feature request list and it will be implemented in any of our upcoming releases. 

Miguel Arenas
Replied On August 16, 2016 12:32 AM UTC

Thank you, I was able to create the Group.

Do the column have to be Int16, Int32, to be able sum?

Dharmendar Dhanasekar [Syncfusion]
Replied On August 16, 2016 12:05 PM UTC

Hi Miguel,

Thanks for the update.Yes, the underlying property associated with the column must be of any numeric type to apply the sum.. You can set summary type as either Int32Aggregate or DoubleAggregate.

GridSummaryRow summaryRow = new GridSummaryRow(); 
summaryRow.Title = "Sum :{CaptionSummary}"; 
summaryRow.ShowSummaryInRow = true; 
    new GridSummaryColumn() 
        Name = "CaptionSummary", 
        MappingName = "Mark1", 
        Format = "{Sum} ", 
        SummaryType = SummaryType.Int32Aggregate 
dataGrid.CaptionSummaryRow = summaryRow; 

We have prepared sample based on this and please download sample from the below link.

Sample link : http://www.syncfusion.com/downloads/support/forum/125365/ze/GroupCaptionDemo-247665733


Miguel Arenas
Replied On August 16, 2016 04:16 PM UTC

Do the field has to be int32?

Divakar Subramaniam [Syncfusion]
Replied On August 17, 2016 10:54 AM UTC

Hi Miguel,   
The underlying property and the field associated to it can be of any numeric type. You do not need to explicitly specify it as Int32. It has to be of numeric type like int or double.    
You can set summary type as either Int32Aggregate or DoubleAggregate based on your requirement to calculate the summary.   
private double mark2;   
public double Mark2   
    get { return mark2; }   
    set { this.mark2 = value; }   
GridSummaryRow summaryRow = new GridSummaryRow();   
summaryRow.Title = "Total Items:{CaptionSummary}";   
summaryRow.ShowSummaryInRow = true;   
new GridSummaryColumn()   
     Name = "CaptionSummary",   
     MappingName = "Mark2",   
     Format = "{Sum} ",   
     SummaryType = SummaryType.Int32Aggregate   
dataGrid.CaptionSummaryRow = summaryRow;   
In above code example, the underlying property is of type double and summary type for it isInt32Aggregate. Here the double values will be rounded off to integer values based on the summary type Int32Aggregate. By the same way, you can use field with Int32 values and summary type as DoubleAggregate.   
We have modified the same in the sample for your reference and you can download it from the below link,   


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon