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.
Unfortunately, activation email could not send to your email. Please try again.

sfDataGRid Group

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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

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

 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. 
 
Regards, 
Divakar. 


Miguel Arenas
Replied On August 15, 2016 08:32 PM

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 08:05 AM

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; 
summaryRow.SummaryColumns.Add( 
    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

Regards,
Dharmendar 


Miguel Arenas
Replied On August 16, 2016 12:16 PM

Do the field has to be int32?

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

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.   
   
StudentInfo.cs:   
   
private double mark2;   
   
public double Mark2   
{   
    get { return mark2; }   
    set { this.mark2 = value; }   
}   
  
   
App.cs:   
   
   
GridSummaryRow summaryRow = new GridSummaryRow();   
summaryRow.Title = "Total Items:{CaptionSummary}";   
summaryRow.ShowSummaryInRow = true;   
summaryRow.SummaryColumns.Add(   
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,   
   
 
Regards, 
Divakar. 


CONFIRMATION

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.

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.

;