cannot copy data when summaries are collapsed

I have an SfDataGrid with approximately 10 summary rows and 50 data rows.
The grid has the copy option to include headers configured.

{
    SfDataGrid1.CopyOption = CopyOptions.CopyData | CopyOptions.IncludeHeaders;
    SfDataGrid1.ClipboardController.CopyRowsToClipboard(0, totalRows - 1);
}

There are 2 problems.
1. Copying all of the rows does not copy the data in the summary rows.
2. Copying all of the rows does not copy the data when a summary row is collapsed.

I was following the example of copying rows without selecting...
https://help.syncfusion.com/windowsforms/datagrid/clipboardoperations#copy-rows-without-selecting

So, how can I copy *everything from the SfDataGrid that is shown to the user including the summary rows?
And two, how can I copy the data without the summary rows being expanded?

Does anyone have any thoughts on this?

Please note that all data rows are copied (not summary rows) when all summaries are expanded, but I require the user to get all data regardless if a summary is expanded or collapsed.

9 Replies 1 reply marked as answer

MA Mohanram Anbukkarasu Syncfusion Team June 14, 2021 01:26 PM UTC

Hi Stoked, 

Thanks for contacting Syncfusion support.  

We are currently validating the reported scenario. We will update with further details on June 16, 2021. We appreciate your patience until then.  

Regards, 
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team June 16, 2021 12:19 PM UTC

Hi Stocked, 

Thanks for your patience.  

We have checked the reported scenario in our end. Currently in SfDataGrid, only the data rows will be copied and the caption row and the collapsed records will be not be copied. However we will check the possibilities to achieve your requirement by any workaround. For that, please confirm the behavior you need to achieve. If you are passing index as 1 to 10 for the CopyToClipboard method, whether you need to copy the first 10 group records with caption or you need to copy the first 10 rows in the view irrespective of whether it is  caption row or data row. Please revert to us with these details. It will be more helpful for us to check for the possibilities and to provide a prompt solution. 

Regards, 
Mohanram A. 




ST Stoked June 16, 2021 12:37 PM UTC

Thank you for the consideration.
Your second assumption is correct, in that, I would want to copy any and all rows (caption, summary, data) that would or could be presented to the end user, regardless if they are collapsed or not. I have many rows in this table, and the summary rows when collapsed do their job.

Please keep me updated on a possible solution / workaround.

Thank you.


MA Mohanram Anbukkarasu Syncfusion Team June 17, 2021 01:13 PM UTC

Hi Stoked, 

Thanks for the update.  

We are currently checking the possibilities to achieve this with sample level workaround. We two more business days to validate this properly. We will update with further details on June 21, 2021. We appreciate your patience until then.  

Regards, 
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team June 21, 2021 12:45 PM UTC

Hi Stocked, 

We regret for the inconvenience. 

We are still working on this. We will update with further details on June 23, 2021. We appreciate your patience and understanding.  

Regards, 
Mohanram A. 
 



MA Mohanram Anbukkarasu Syncfusion Team June 23, 2021 11:47 AM UTC

Hi Stocked, 

Thanks for your patience.  

We have prepared a sample to copy the records including the group caption even though the group is collapsed by customizing the clipboard operations and it is available in the following link for you reference.  


Please have a look at this sample and revert to us if you have any concerns in this.  

Regards, 
Mohanram A. 


Marked as answer

ST Stoked June 23, 2021 01:22 PM UTC

Thank you for the code revision. I will review and run the code and update this thread when I have done so.

Regards.



ST Stoked June 24, 2021 03:19 AM UTC

Support, the demo code provided works as expected. Thank you. I will incorporate it into my project to see how it works within it. I will update this thread when/if I should encounter any issues.

Regards.



MA Mohanram Anbukkarasu Syncfusion Team June 24, 2021 03:22 AM UTC

Hi Stocked, 

Thanks for the update.  

We will wait to hear from you.  

Regards, 
Mohanram A. 


Loader.
Up arrow icon