Class Cells
Provides access to the cells in a worksheet, managing their values, formatting, data validation, and merged ranges with sparse storage.
Inherited Members
Namespace: Telerik.Windows.Documents.Spreadsheet.Model
Assembly: Telerik.Windows.Documents.Spreadsheet.dll
Syntax
public class Cells : WorksheetEntityBase
Properties
ColumnCount
Gets the maximum number of columns in the worksheet.
Declaration
public int ColumnCount { get; }
Property Value
|
System.Int32
The column count. |
Item[IEnumerable<CellRange>]
Gets the CellSelection with the specified cell ranges.
Declaration
public CellSelection this[IEnumerable<CellRange> cellRanges] { get; }
Parameters
|
System.Collections.Generic.IEnumerable<CellRange>
cellRanges
|
Property Value
|
CellSelection
The cell selection. |
Item[Int32, Int32]
Gets the CellSelection with the specified row and column indices.
Declaration
public CellSelection this[int rowIndex, int columnIndex] { get; }
Parameters
|
System.Int32
rowIndex
|
|
System.Int32
columnIndex
|
Property Value
|
CellSelection
The cell selection. |
Item[Int32, Int32, Int32, Int32]
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
|
System.Int32
fromRowIndex
|
|
System.Int32
fromColumnIndex
|
|
System.Int32
toRowIndex
|
|
System.Int32
toColumnIndex
|
Property Value
|
CellSelection
The cell selection. |
Item[CellIndex]
Gets the CellSelection with the specified cell index.
Declaration
public CellSelection this[CellIndex cellIndex] { get; }
Parameters
|
CellIndex
cellIndex
|
Property Value
|
CellSelection
The cell selection. |
Item[CellIndex, CellIndex]
Gets the CellSelection with the specified start and end indices.
Declaration
public CellSelection this[CellIndex fromIndex, CellIndex toIndex] { get; }
Parameters
|
CellIndex
fromIndex
|
|
CellIndex
toIndex
|
Property Value
|
CellSelection
The cell selection. |
Item[CellRange]
Gets the CellSelection with the specified cell range.
Declaration
public CellSelection this[CellRange cellRange] { get; }
Parameters
|
CellRange
cellRange
|
Property Value
|
CellSelection
The cell selection. |
RowCount
Gets the maximum number of rows in the worksheet.
Declaration
public int RowCount { get; }
Property Value
|
System.Int32
The row count. |
Methods
CanInsert(Int32, Int32, Int32, 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
|
System.Int32
rowIndex
Index of the row. |
|
System.Int32
columnIndex
Index of the column. |
|
System.Int32
itemCount
The item count. |
|
InsertShiftType
shiftType
Type of the shift. |
Returns
|
System.Boolean
The value indicating whether cells can be inserted at the specified row index. |
CanInsert(CellRange, InsertShiftType)
Determines whether cells can be inserted at the specified cell range.
Declaration
public bool CanInsert(CellRange cellRange, InsertShiftType shiftType)
Parameters
|
CellRange
cellRange
The cell range. |
|
InsertShiftType
shiftType
Type of the shift. |
Returns
|
System.Boolean
The value indicating whether cells can be inserted at the specified cell range. |
GetCellSelection(IEnumerable<CellRange>)
Gets the cell selection.
Declaration
public CellSelection GetCellSelection(IEnumerable<CellRange> cellRanges)
Parameters
|
System.Collections.Generic.IEnumerable<CellRange>
cellRanges
The cell ranges. |
Returns
|
CellSelection
The cell selection. |
GetCellSelection(Int32, Int32)
Gets cell selection.
Declaration
public CellSelection GetCellSelection(int rowIndex, int columnIndex)
Parameters
|
System.Int32
rowIndex
Index of the row. |
|
System.Int32
columnIndex
Index of the column. |
Returns
|
CellSelection
The cell selection. |
GetCellSelection(Int32, Int32, Int32, Int32)
Gets cell selection.
Declaration
public CellSelection GetCellSelection(int fromRowIndex, int fromColumnIndex, int toRowIndex, int toColumnIndex)
Parameters
|
System.Int32
fromRowIndex
Start row index. |
|
System.Int32
fromColumnIndex
Start column index. |
|
System.Int32
toRowIndex
End row index. |
|
System.Int32
toColumnIndex
End column index. |
Returns
|
CellSelection
The cell selection. |
GetCellSelection(CellIndex)
Gets cell selection.
Declaration
public CellSelection GetCellSelection(CellIndex cellIndex)
Parameters
|
CellIndex
cellIndex
Index of the cell. |
Returns
|
CellSelection
The cell selection. |
GetCellSelection(CellIndex, CellIndex)
Gets cell selection.
Declaration
public CellSelection GetCellSelection(CellIndex fromIndex, CellIndex toIndex)
Parameters
|
CellIndex
fromIndex
Start index. |
|
CellIndex
toIndex
End index. |
Returns
|
CellSelection
The cell selection. |
GetCellSelection(CellRange)
Gets cell selection.
Declaration
public CellSelection GetCellSelection(CellRange cellRange)
Parameters
|
CellRange
cellRange
The cell range. |
Returns
|
CellSelection
The cell selection. |
GetContainingMergedRanges(CellRange)
Gets the merged ranges containing the specified cell range.
Declaration
public IEnumerable<CellRange> GetContainingMergedRanges(CellRange range)
Parameters
|
CellRange
range
The range. |
Returns
|
System.Collections.Generic.IEnumerable<CellRange>
The merged ranges containing the specified cell range. |
GetIsMerged(CellIndex)
Gets the value indicating whether the cell index is contained in a merged range.
Declaration
public bool GetIsMerged(CellIndex cellIndex)
Parameters
|
CellIndex
cellIndex
Index of the cell. |
Returns
|
System.Boolean
The value indicating whether the cell index is contained in a merged range. |
GetMergedCellRanges()
Gets the merged cell ranges.
Declaration
public IEnumerable<CellRange> GetMergedCellRanges()
Returns
|
System.Collections.Generic.IEnumerable<CellRange>
The cell ranges. |
GetMergeState(Int32, Int32)
Gets the merge state.
Declaration
public CellMergeState GetMergeState(int rowIndex, int columnIndex)
Parameters
|
System.Int32
rowIndex
Index of the row. |
|
System.Int32
columnIndex
Index of the column. |
Returns
|
CellMergeState
The merge state. |
GetMergeState(CellIndex)
Gets the merge state.
Declaration
public CellMergeState GetMergeState(CellIndex cellIndex)
Parameters
|
CellIndex
cellIndex
Index of the cell. |
Returns
|
CellMergeState
The merge state. |
Insert(Int32, Int32, Int32, InsertShiftType)
Inserts the specified number of items at the specified location.
Declaration
public bool Insert(int rowIndex, int columnIndex, int itemCount, InsertShiftType shiftType)
Parameters
|
System.Int32
rowIndex
Index of the row. |
|
System.Int32
columnIndex
Index of the column. |
|
System.Int32
itemCount
The item count. |
|
InsertShiftType
shiftType
Type of the shift. |
Returns
|
System.Boolean
The value indicating whether the insertion was successful. |
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
cellRange
The cell range. |
|
InsertShiftType
shiftType
Type of the shift. |
Returns
|
System.Boolean
The value indicating whether the insertion was successful. |
OnCellPropertyChanged(CellPropertyChangedEventArgs)
Raises the CellPropertyChanged event.
Declaration
protected virtual void OnCellPropertyChanged(CellPropertyChangedEventArgs args)
Parameters
|
CellPropertyChangedEventArgs
args
The CellPropertyChangedEventArgs instance containing the event data. |
OnCellRangeInsertedOrRemoved(CellRangeInsertedOrRemovedEventArgs)
Raises the CellRangeInsertedOrRemoved event.
Declaration
protected virtual void OnCellRangeInsertedOrRemoved(CellRangeInsertedOrRemovedEventArgs args)
Parameters
|
CellRangeInsertedOrRemovedEventArgs
args
The CellRangeInsertedOrRemovedEventArgs instance containing the event data. |
OnMergedCellsChanged(MergedCellRangesChangedEventArgs)
Raises the MergedCellsChanged event.
Declaration
protected virtual void OnMergedCellsChanged(MergedCellRangesChangedEventArgs args)
Parameters
|
MergedCellRangesChangedEventArgs
args
The MergedCellRangesChangedEventArgs instance containing the event data. |
Remove(Int32, Int32, Int32, RemoveShiftType)
Removes the specified number of items at the specified location.
Declaration
public void Remove(int rowIndex, int columnIndex, int itemCount, RemoveShiftType shiftType)
Parameters
|
System.Int32
rowIndex
Index of the row. |
|
System.Int32
columnIndex
Index of the column. |
|
System.Int32
itemCount
The item count. |
|
RemoveShiftType
shiftType
Type of the shift. |
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
cellRange
The cell range. |
|
RemoveShiftType
shiftType
Type of the shift. |
TryGetContainingMergedRange(CellIndex, out CellRange)
Tries to get the merged range containing the index.
Declaration
public bool TryGetContainingMergedRange(CellIndex cellIndex, out CellRange mergedRange)
Parameters
|
CellIndex
cellIndex
Index of the cell. |
|
CellRange
mergedRange
The merged range. |
Returns
|
System.Boolean
The value indicating whether precisely a range was found. |
Events
CellPropertyChanged
Occurs when a cell property is changed.
Declaration
public event EventHandler<CellPropertyChangedEventArgs> CellPropertyChanged
Event Type
|
System.EventHandler<CellPropertyChangedEventArgs>
|
CellRangeInsertedOrRemoved
Occurs when a cell range is inserted or removed.
Declaration
public event EventHandler<CellRangeInsertedOrRemovedEventArgs> CellRangeInsertedOrRemoved
Event Type
|
System.EventHandler<CellRangeInsertedOrRemovedEventArgs>
|
MergedCellsChanged
Occurs when merged cells are changed.
Declaration
public event EventHandler<MergedCellRangesChangedEventArgs> MergedCellsChanged
Event Type
|
System.EventHandler<MergedCellRangesChangedEventArgs>
|