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