The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I would like to be able to select a range of cells (including the row/col headers), copy them, and then paste them into Excel. However, the default behavious only copies the standard cells, not the headers. Is there any quick way round this, or do I have to write my open copy/paste code?
Thanks
Akash
ADAdministrator Syncfusion Team September 22, 2005 01:32 PM UTC
Hi Akash,
You can use the ClipboardCopy event to add the column headers to the ranges being copied. Below is a snippet.
private void Model_ClipboardCopy(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
{
if(!e.RangeList.AnyRangeContains(GridRangeInfo.Row(0)))
{
e.ClipboardFlags |= GridDragDropFlags.ColHeader;
e.RangeList.Add(GridRangeInfo.Row(0));
}
}
Best regards,
Jay N
ADAdministrator Syncfusion Team September 30, 2005 03:08 PM UTC
Thanks Jay,
All I needed was the clipboardflags settings - I only want to include the row/col headers if the user has selected them.
Akash
>Hi Akash,
>You can use the ClipboardCopy event to add the column headers to the ranges being copied. Below is a snippet.
>
>
>private void Model_ClipboardCopy(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
>{
>if(!e.RangeList.AnyRangeContains(GridRangeInfo.Row(0)))
>{
>e.ClipboardFlags |= GridDragDropFlags.ColHeader;
>e.RangeList.Add(GridRangeInfo.Row(0));
>}
>}
>
>
>Best regards,
>Jay N