Class Worksheet
Two-dimensional grid organizing cells into rows and columns with filtering, sorting, formulas, and styling. Use to manage worksheet content, properties, and layout within a workbook.
Inherited Members
Namespace: Telerik.Windows.Documents.Spreadsheet.Model
Assembly: Telerik.Windows.Documents.Spreadsheet.dll
Syntax
public class Worksheet : Sheet, INotifyPropertyChanged, ISheet, IDisposable
Properties
Cells
Provides access to the cell collection for reading and modifying cell content, formulas, and formatting.
Declaration
public Cells Cells { get; }
Property Value
|
Cells
The cells of the worksheet. |
Charts
Provides access to charts visualizing data from the worksheet or other sources.
Declaration
public ChartCollection Charts { get; }
Property Value
|
ChartCollection
The charts. |
Columns
Provides access to the column collection for managing column widths, visibility, and column-level formatting.
Declaration
public Columns Columns { get; }
Property Value
|
Columns
The columns of the worksheet. |
Comments
Provides access to modern threaded comments attached to cells in the worksheet.
Declaration
public CommentCollection Comments { get; }
Property Value
|
CommentCollection
The comments. |
DefaultColumnWidth
Controls the default column width applied to columns without explicit width settings.
Declaration
public ColumnWidth DefaultColumnWidth { get; set; }
Property Value
|
ColumnWidth
The default width of the column. |
DefaultRowHeight
Controls the default row height applied to rows without explicit height settings.
Declaration
public RowHeight DefaultRowHeight { get; set; }
Property Value
|
RowHeight
The default height of the row. |
Filter
Provides access to the auto-filter configuration for hiding rows based on column criteria.
Declaration
public AutoFilter Filter { get; }
Property Value
|
AutoFilter
The filtering of the worksheet. |
GroupingProperties
Provides access to row and column grouping settings for outlining and collapsing data sections.
Declaration
public GroupingProperties GroupingProperties { get; }
Property Value
|
GroupingProperties
The grouping properties. |
HeaderNameRenderingConverter
Controls how row and column headers are rendered, enabling custom labeling schemes beyond default A-Z and 1-N.
Declaration
public HeaderNameRenderingConverterBase HeaderNameRenderingConverter { get; set; }
Property Value
|
HeaderNameRenderingConverterBase
The header name rendering converter. |
Hyperlinks
Provides access to the collection of hyperlinks defined in the worksheet for navigation and external references.
Declaration
public HyperlinkCollection Hyperlinks { get; }
Property Value
|
HyperlinkCollection
The hyperlinks. |
Images
Provides access to floating images positioned on the worksheet.
Declaration
public ImageCollection Images { get; }
Property Value
|
ImageCollection
The images. |
Names
Provides access to worksheet-scoped named ranges and constants that can be referenced in formulas.
Declaration
public NameCollection Names { get; }
Property Value
|
NameCollection
The collection of defined names of the worksheet. |
Notes
Provides access to cell notes (legacy comments) attached to cells in the worksheet.
Declaration
public NoteCollection Notes { get; }
Property Value
|
NoteCollection
The notes. |
ProtectionOptions
Controls which operations users can perform on a protected worksheet, such as inserting rows or formatting cells.
Declaration
public WorksheetProtectionOptions ProtectionOptions { get; }
Property Value
|
WorksheetProtectionOptions
The protection options. |
Rows
Provides access to the row collection for managing row heights, visibility, and row-level formatting.
Declaration
public Rows Rows { get; }
Property Value
|
Rows
The rows of the worksheet. |
SheetPageSetup
Returns the base page setup implementation for this sheet type.
Declaration
protected override sealed SheetPageSetupBase SheetPageSetup { get; }
Property Value
|
SheetPageSetupBase
The sheet page setup. |
Overrides
SortState
Provides access to the current sort configuration applied to the worksheet data.
Declaration
public SortState SortState { get; }
Property Value
|
SortState
The sort state. |
Type
Returns the sheet type identifier, always SheetType.Worksheet for worksheet instances.
Declaration
public override SheetType Type { get; }
Property Value
|
SheetType
The type of the sheet. |
Overrides
UsedCellRange
Returns the bounding range encompassing all cells with content or formatting, indicating the worksheet's active data area.
Declaration
public CellRange UsedCellRange { get; }
Property Value
|
CellRange
The used cell range. |
ViewState
Provides access to display settings including zoom, frozen panes, selection, and gridline visibility.
Declaration
public WorksheetViewState ViewState { get; }
Property Value
|
WorksheetViewState
The view state of the worksheet. |
WorksheetPageSetup
Provides access to page layout settings for printing and PDF export, including margins, orientation, and paper size.
Declaration
public WorksheetPageSetup WorksheetPageSetup { get; }
Property Value
|
WorksheetPageSetup
The worksheet page setup. |
Methods
CopyFrom(Worksheet)
Copies Worksheet contents from a source Worksheet into this instance. This Worksheet instance contents are overridden from the source Worksheet contents.
Declaration
public void CopyFrom(Worksheet sourceWorksheet)
Parameters
|
Worksheet
sourceWorksheet
The worksheet to copy from. |
CreateViewState()
Creates a new WorksheetViewState instance initialized with default display settings.
Declaration
protected override ISheetViewState CreateViewState()
Returns
|
ISheetViewState
A new worksheet view state. |
Overrides
Dispose(Boolean)
Disposes the specified disposing.
Declaration
protected override void Dispose(bool disposing)
Parameters
|
System.Boolean
disposing
The disposing. |
Overrides
Find(FindOptions)
Searches for the first occurrence of text in the worksheet matching the specified criteria and returns its location.
Declaration
public FindResult Find(FindOptions findOptions)
Parameters
|
FindOptions
findOptions
The find options. |
Returns
|
FindResult
The first matching result, or null if not found. |
FindAll(FindOptions)
Searches for all occurrences of text in the worksheet matching the specified criteria and returns their locations.
Declaration
public IEnumerable<FindResult> FindAll(FindOptions findOptions)
Parameters
|
FindOptions
findOptions
The find options. |
Returns
|
System.Collections.Generic.IEnumerable<FindResult>
All matching results in the worksheet. |
GetUsedCellRange(IEnumerable<IPropertyDefinition>)
Gets the used cell range for specific cell property definitions.
Declaration
public CellRange GetUsedCellRange(IEnumerable<IPropertyDefinition> propertyDefinitions)
Parameters
|
System.Collections.Generic.IEnumerable<IPropertyDefinition>
propertyDefinitions
The cell property definitions from CellPropertyDefinitions |
Returns
|
CellRange
The used cell range for specific cell property definitions. |
GetUsedCellRange(IPropertyDefinition)
Gets the used cell range for a specific cell property definition.
Declaration
public CellRange GetUsedCellRange(IPropertyDefinition propertyDefinition)
Parameters
|
IPropertyDefinition
propertyDefinition
The cell property definition from CellPropertyDefinitions |
Returns
|
CellRange
The used cell range for specific cell property definitions. |
Protect(String, WorksheetProtectionOptions)
Protects the worksheet.
Declaration
public void Protect(string password, WorksheetProtectionOptions options)
Parameters
|
System.String
password
The password. |
|
WorksheetProtectionOptions
options
The protection options of the worksheet. |
Replace(ReplaceOptions)
Executes replace action according to the specified replace options.
Declaration
public bool Replace(ReplaceOptions replaceOptions)
Parameters
|
ReplaceOptions
replaceOptions
The replace options. |
Returns
|
System.Boolean
The value indicating whether a value was found to replace. |
ReplaceAll(ReplaceOptions)
Executes replace all action according to the specified replace options.
Declaration
public int ReplaceAll(ReplaceOptions replaceOptions)
Parameters
|
ReplaceOptions
replaceOptions
The replace options. |
Returns
|
System.Int32
The number of replacements made. |
Unprotect(String)
Unprotects the worksheet.
Declaration
public bool Unprotect(string password)
Parameters
|
System.String
password
The password. |
Returns
|
System.Boolean
|