ClassWorksheet
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.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.Model
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public class Worksheet : Sheet, INotifyPropertyChanged, ISheet, IDisposable
Inheritance: objectNotifyPropertyChangedBaseSheetWorksheet
Implements:
Inherited Members
Properties
Cells
Provides access to the cell collection for reading and modifying cell content, formulas, and formatting.
Declaration
public Cells Cells { get; }
Property Value
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
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
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
The comments.
DefaultColumnWidth
Controls the default column width applied to columns without explicit width settings.
Declaration
public ColumnWidth DefaultColumnWidth { get; set; }
Property Value
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
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
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
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
The hyperlinks.
Images
Provides access to floating images positioned on the worksheet.
Declaration
public ImageCollection Images { get; }
Property Value
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
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
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
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
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
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
The sort state.
Type
Returns the sheet type identifier, always SheetType.Worksheet for worksheet instances.
Declaration
public override SheetType Type { get; }
Property Value
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
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
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
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
sourceWorksheet
The worksheet to copy from.
CreateViewState()
Creates a new WorksheetViewState instance initialized with default display settings.
Declaration
protected override ISheetViewState CreateViewState()
Returns
A new worksheet view state.
Overrides
Dispose(bool)
Disposes the specified disposing.
Declaration
protected override void Dispose(bool disposing)
Parameters
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
The find options.
Returns
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
The find options.
Returns
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
propertyDefinitions
IEnumerable<IPropertyDefinition>
The cell property definitions from CellPropertyDefinitions
Returns
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
propertyDefinition
The cell property definition from CellPropertyDefinitions
Returns
The used cell range for specific cell property definitions.
Protect(string, WorksheetProtectionOptions)
Protects the worksheet.
Declaration
public void Protect(string password, WorksheetProtectionOptions options)
Parameters
password
The password.
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
The replace options.
Returns
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
The replace options.
Returns
The number of replacements made.
Unprotect(string)
Unprotects the worksheet.