DeleteRangeCommandBase Class

Base class for row and column delete commands. Captures only the cells that will be removed or whose formulas reference the deleted range, then performs the delete. Undo re-inserts the blank rows/columns and restores the captured cells in place. Snapshot/restore plumbing is inherited from RangeSnapshotCommandBase.

Namespace: Radzen.Blazor.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

public abstract class DeleteRangeCommandBase : Spreadsheet.RangeSnapshotCommandBase, Spreadsheet.ICommand, Spreadsheet.IProtectedCommand

Constructors

DeleteRangeCommandBaseLink to this section

Initializes a new instance of the DeleteRangeCommandBase class.

Declaration
protected DeleteRangeCommandBase(Documents.Spreadsheet.Worksheet sheet, int startIndex, int endIndex)
Parameters
Type Name Description
Documents.Spreadsheet.Worksheet sheet The worksheet to modify.
int startIndex The first row/column index to delete (inclusive).
int endIndex The last row/column index to delete (inclusive).

Fields

endIndexLink to this section

The last index in the range to delete (inclusive).

Declaration
protected readonly int endIndex

startIndexLink to this section

The first index in the range to delete (inclusive).

Declaration
protected readonly int startIndex

Properties

CountLink to this section

Gets the number of indices in the deletion range.

Declaration
protected int Count { get; }
Property Value
Type Description
intGets the number of indices in the deletion range.

Methods

DeleteRangeLink to this section

Deletes the row/column range from the worksheet.

Declaration
protected abstract void DeleteRange()

DoExecuteLink to this section

Declaration
protected override bool DoExecute()
Returns
Type Description
bool

IsInsideRangeLink to this section

Returns true when the cell at address falls inside the deletion range.

Declaration
protected abstract bool IsInsideRange(Documents.Spreadsheet.CellRef address)
Parameters
Type Name Description
Documents.Spreadsheet.CellRef address
Returns
Type Description
bool

ReferencesRangeLink to this section

Returns true when the formula of cell references any row/column inside the deletion range — these cells get rewritten to #REF! by the worksheet and must be snapshotted for undo.

Declaration
protected abstract bool ReferencesRange(Documents.Spreadsheet.Cell cell)
Parameters
Type Name Description
Documents.Spreadsheet.Cell cell
Returns
Type Description
bool

ReinsertRangeLink to this section

Re-inserts Count blank rows/columns at startIndex.

Declaration
protected abstract void ReinsertRange()

UnexecuteLink to this section

Declaration
public override void Unexecute()
An error has occurred. This app may no longer respond until reloaded. Reload 🗙