Updating Datasource with new List and Grouping and CaptionSummary Row

I am having some issues with updating the datasource when I use the grouping function. Currently I am using a list as a datasource for the value. When I remove the grouping function of the SFdatagrid, I can add the entry into the list and it updates perfectly fine. 

But when I want to modify/add to the list and reupdate the datasource with grouping, I get an error of  "The given key was not present in the dictionary." I'm not sure what the issue is but this is not allowing me to add anything to the list.

In addition, I am trying to use the caption summary row. I have run into the issue where I cannot get the title with the caption summary. I am following https://help.syncfusion.com/windowsforms/datagrid/summaries -> Displaying Column Summary with Title, however I noticed 2 things. 
1) I don't see a function for TitleColumnCount
2) The title does not show only the summary of the column shows.

Please help, I have uploaded a simplified version of the code in attachments and below:


public class WorkloadGrid
        {
            [DisplayName("Project #")]
            public string Project { get; set; }
            [DisplayName("number1")]
            public int number1 { get; set; }
        }

        List<WorkloadGrid> workloadGridViewList = new List<WorkloadGrid>();


        private void sfButton1_Click(object sender, EventArgs e)
        {
            WorkloadGrid workloadObj = new WorkloadGrid();
            workloadObj.Project = "HIHI";
            workloadObj.number1 = 1;
            workloadGridViewList.Add(workloadObj);

            sfDataGrid1.DataSource = workloadGridViewList.ToList();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            for (var i = 0; i < 10; i++)
            {
                WorkloadGrid workloadObji = new WorkloadGrid();
                workloadObji.Project = i.ToString() ;
                workloadObji.number1 = i;
                workloadGridViewList.Add(workloadObji);

            }

            sfDataGrid1.DataSource = workloadGridViewList.ToList();

            GridSummaryRow captionSummaryRow = new GridSummaryRow();
            captionSummaryRow.Name = "CaptionSummary";
            captionSummaryRow.ShowSummaryInRow = false;
            captionSummaryRow.Title = "{Key}";

            // Creates the GridSummaryColumn.
            GridSummaryColumn summaryColumn1 = new GridSummaryColumn();
            summaryColumn1.Name = "number1";
            summaryColumn1.SummaryType = SummaryType.DoubleAggregate;
            summaryColumn1.Format = "{Sum:N2}";
            summaryColumn1.MappingName = "number1";


            // Adds the summary column in the SummaryColumns collection.
            captionSummaryRow.SummaryColumns.Add(summaryColumn1);

            // Initializes the caption summary row.
            this.sfDataGrid1.CaptionSummaryRow = captionSummaryRow;
        }
    }


Attachment: WindowsFormsApp1_dd6fa9f0.rar

1 Reply 1 reply marked as answer

MA Mohanram Anbukkarasu Syncfusion Team March 5, 2021 12:11 PM UTC

Hi Julius, 
 
Thanks for contacting Syncfusion support.  
 
The support to provide both title summary and column summary has been included from our Essential Studio version 18.1.0.42 and above. We suspect that you are using version older than that which is the cause for the reported problem. We suggest you to upgrade your Syncfusion product version to 18.1.0.42 or above to make use of this feature. Please let us know if you require any other assistance from us.  
 
Regards, 
Mohanram A. 


Marked as answer
Loader.
Up arrow icon