Category / Section
How to Clear the Spreadsheet data?
1 min read
Spreadsheet control allows you to clear the worksheet by using two ways:
- ClearData()
- Clear()
ClearData():
This function clears only the content in each cell of the worksheet. You can use the following code example for reference.
C#
this.spreadSheetControl.ExcelProperties.WorkBook.ActiveSheet.ClearData(); this.spreadSheetControl.GridProperties.ActiveSpreadsheetGrid.InvalidateCells();
Clear():
This function entirely (i.e. content, formatting, merged cells) clears the worksheet.
C#
this.spreadSheetControl.ExcelProperties.WorkBook.ActiveSheet.Clear(); this.spreadSheetControl.GridProperties.ActiveSpreadsheetGrid.InvalidateCells();