Select all to include header

I am executing the below command and is working well in getting the values.

this.sfDataGrid.SelectAll();

this.sfDataGrid.ClipboardController.Copy();


 How can I add to copy the header?


1 Reply

MA Mohanram Anbukkarasu Syncfusion Team December 13, 2021 11:32 AM UTC

Hi Mark, 

To copy the column header along with the data you have to set SfDataGrid.CopyOption as both CopyOptions.CopyData | CopyOptions.IncludeHeaders as shown in the following code example.  

Code example :  

this.sfDataGrid1.CopyOption = CopyOptions.CopyData | CopyOptions.IncludeHeaders; 

Please let us know if you require any other assistance from us.  

Regards, 
Mohanram A. 


Loader.
Up arrow icon