rangeInfo = new GridRangeInfoList();
IRange range = spreadsheet.Workbook.Worksheets[0].Range[2, 2, 2, 7];
//To convert the IRange into GridRangeInfo.
rangeInfo.Add(GridExcelHelper.ConvertExcelRangeToGridRange(range));
//To convert the GridRangeInfo into IRange
//string iRange = GridExcelHelper.ConvertGridRangeToExcelRange(rangeInfo, spreadsheet.ActiveGrid);
spreadsheet.CopyPaste.Copy(rangeInfo[0], false);
//To paste the copied content in another sheet.
spreadsheet.CopyPaste.Paste(rangeInfo, Syncfusion.Windows.Forms.Spreadsheet.PasteOptions.Paste); |
GridRangeInfoList list = new GridRangeInfoList();
IRange range = spreadsheet.Workbook.Worksheets[1].Range[4, 5, 4, 11];
//To convert the IRange into GridRangeInfo.
list.Add(GridExcelHelper.ConvertExcelRangeToGridRange(range));
string backUpSheet = spreadsheet.ActiveSheet.Name;
//To change the active grid.
spreadsheet.SetActiveSheet(range.Worksheet.Name);
//To paste the copied content in another sheet.
spreadsheet.CopyPaste.Paste(list, Syncfusion.Windows.Forms.Spreadsheet.PasteOptions.Paste);
//Revert to the previous sheet, if needed.
//spreadsheet.SetActiveSheet(backUpSheet); |