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

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

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

Declaration
protected readonly int endIndex

startIndexlink

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

Declaration
protected readonly int startIndex

Properties

Countlink

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

Deletes the row/column range from the worksheet.

Declaration
protected abstract void DeleteRange()

DoExecutelink

Declaration
protected override bool DoExecute()
Returns
Type Description
bool

IsInsideRangelink

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

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

Re-inserts Count blank rows/columns at startIndex.

Declaration
protected abstract void ReinsertRange()

Unexecutelink

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