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

GridSummaryRow

After adding GridSummaryRow, the GroupColumnDescription is replaced, how can I keep both?



            GridSummaryRow subtotal = new GridSummaryRow();            
            subtotal.Title = " Total Items:{CaptionSummary}";            
            subtotal.ShowSummaryInRow = true;
            subtotal.SummaryColumns.Add(
                    new GridSummaryColumn()
                    {
                        Name = "CaptionSummary",
                        MappingName = "Invent",
                        Format = "{Sum}",
                        SummaryType = Syncfusion.Data.SummaryType.Int32Aggregate
                    }

                    );

            sfGrid.CaptionSummaryRow = subtotal;

            sfGrid.GroupColumnDescriptions.Add(new GroupColumnDescription() { ColumnName = "Product" });


1 Reply

AN Ashok N Syncfusion Team August 17, 2016 09:12 PM UTC

Hi Miguel, 

Thank you contacting Syncfusion Support, 

We have checked your query and you can achieve your requirement by setting CaptionSummaryRow format first using summaryRow.Title and set the GridSummaryRow as in the below code example: 
GridSummaryRow summaryRow = new GridSummaryRow(); 
summaryRow.Title = "StudentID: {Key} - {CaptionSummary}"; 
summaryRow.ShowSummaryInRow = true; 
var summaryColumn = new GridSummaryColumn() 
{ 
    Name = "CaptionSummary", 
    MappingName = "StudentID", 
    Format = " {Count} --- TotalItems : {Sum}", 
    SummaryType = SummaryType.Int32Aggregate 
}; 
             
summaryRow.SummaryColumns.Add(summaryColumn); 
sfGrid.CaptionSummaryRow = summaryRow; 
sfGrid.GroupColumnDescriptions.Add(new GroupColumnDescription() { ColumnName = "StudentID" }); 

You can download the sample from the below link: 

Regards, 
Ashok 


Loader.
Up arrow icon