Cells
Provides access to the cells in a worksheet, managing their values, formatting, data validation, and merged ranges with sparse storage.
Definition
Namespace:Telerik.Documents.Spreadsheet.Model
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public class Cells : WorksheetEntityBase
Inheritance: objectWorksheetEntityBaseCells
Inherited Members
Properties
Gets the maximum number of columns in the worksheet.
public int ColumnCount { get; }
The column count.
Gets the maximum number of rows in the worksheet.
public int RowCount { get; }
The row count.
Gets the CellSelection with the specified start and end indices.
Gets the CellSelection with the specified cell index.
public CellSelection this[CellIndex cellIndex] { get; }
The cell selection.
Gets the CellSelection with the specified cell range.
public CellSelection this[CellRange cellRange] { get; }
The cell selection.
Gets the CellSelection with the specified cell ranges.
public CellSelection this[IEnumerable<CellRange> cellRanges] { get; }
The cell selection.
Gets the CellSelection with the specified start row index, start column index, end row index and end column index.
Gets the CellSelection with the specified row and column indices.
Methods
Determines whether cells can be inserted at the specified cell range.
public bool CanInsert(CellRange cellRange, InsertShiftType shiftType)
The cell range.
shiftTypeInsertShiftTypeType of the shift.
Returns:The value indicating whether cells can be inserted at the specified cell range.
Checks whether cells can be inserted starting at the specified position without violating constraints like merged ranges or filters.
public bool CanInsert(int rowIndex, int columnIndex, int itemCount, InsertShiftType shiftType)
Index of the row.
columnIndexintIndex of the column.
itemCountintThe item count.
shiftTypeInsertShiftTypeType of the shift.
Returns:The value indicating whether cells can be inserted at the specified row index.
Gets cell selection.
public CellSelection GetCellSelection(CellIndex cellIndex)
Index of the cell.
Returns:The cell selection.
Gets cell selection.
public CellSelection GetCellSelection(CellRange cellRange)
The cell range.
Returns:The cell selection.
Gets the cell selection.
public CellSelection GetCellSelection(IEnumerable<CellRange> cellRanges)
The cell ranges.
Returns:The cell selection.
Gets cell selection.
Gets the merged ranges containing the specified cell range.
public IEnumerable<CellRange> GetContainingMergedRanges(CellRange range)
The range.
Returns:The merged ranges containing the specified cell range.
Gets the merged cell ranges.
public IEnumerable<CellRange> GetMergedCellRanges()
The cell ranges.
Gets the merge state.
public CellMergeState GetMergeState(CellIndex cellIndex)
Index of the cell.
Returns:The merge state.
Inserts empty cells at the specified range, shifting existing cells down or right, and returns whether the operation succeeded.
public bool Insert(CellRange cellRange, InsertShiftType shiftType)
The cell range.
shiftTypeInsertShiftTypeType of the shift.
Returns:The value indicating whether the insertion was successful.
Inserts the specified number of items at the specified location.
public bool Insert(int rowIndex, int columnIndex, int itemCount, InsertShiftType shiftType)
Index of the row.
columnIndexintIndex of the column.
itemCountintThe item count.
shiftTypeInsertShiftTypeType of the shift.
Returns:The value indicating whether the insertion was successful.
Raises the event.
protected virtual void OnCellPropertyChanged(CellPropertyChangedEventArgs args)
The CellPropertyChangedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnCellRangeInsertedOrRemoved(CellRangeInsertedOrRemovedEventArgs args)
The CellRangeInsertedOrRemovedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnMergedCellsChanged(MergedCellRangesChangedEventArgs args)
The MergedCellRangesChangedEventArgs instance containing the event data.
Removes cells at the specified range and shifts remaining cells up or left to fill the gap.
public void Remove(CellRange cellRange, RemoveShiftType shiftType)
The cell range.
shiftTypeRemoveShiftTypeType of the shift.
Removes the specified number of items at the specified location.
public void Remove(int rowIndex, int columnIndex, int itemCount, RemoveShiftType shiftType)
Index of the row.
columnIndexintIndex of the column.
itemCountintThe item count.
shiftTypeRemoveShiftTypeType of the shift.
Events
Occurs when a cell property is changed.
public event EventHandler<CellPropertyChangedEventArgs> CellPropertyChanged
Occurs when a cell range is inserted or removed.
public event EventHandler<CellRangeInsertedOrRemovedEventArgs> CellRangeInsertedOrRemoved
Occurs when merged cells are changed.
public event EventHandler<MergedCellRangesChangedEventArgs> MergedCellsChanged