For example if I have a CellSelection coordinates how can I retrieve the values from all cells and move it like a cut and paste text in another part of my export excel file?
1 Answer, 1 is accepted
0
Boby
Telerik team
answered on 01 Nov 2016, 06:30 AM
Hello Mae,
I guess the question here is the same as in the other forum thread you started in the WPF forum here. I will post the sample code for cut/paste here also for clarity:
using (new UpdateScope(workbook.History.BeginUndoGroup, workbook.History.EndUndoGroup))
{
CellRange copiedCellRange = new CellRange(0, 0, 2, 1);
worksheet.Cells[3, 3, 5, 4].Paste(worksheetFragment, new PasteOptions(PasteType.All));
}
If you do not need history, you can disable it using workbook.History.IsEnabled property and skip the using (new UpdateScope(workbook.History.BeginUndoGroup, workbook.History.EndUndoGroup)) part. This can improve your performance and memory consumption, especially if you are moving large fragments around.