# OdsCell

An XML-backed ODS cell produced without expanding surrounding repeat runs.

Class 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OdsCell.cs:131](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L131)

**Modifiers**

sealed

An XML-backed ODS cell produced without expanding surrounding repeat runs.

## Inheritance

- object
- OdsCell

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Method [OdsSheet.Cell](/api/open-document/officeimo-opendocument-odssheet/#method-cell-int64-int64)
- Method [OdsSheet.Merge](/api/open-document/officeimo-opendocument-odssheet/#method-merge-int64-int64-int64-int64)

Filter members 

Show inherited

## Methods

`public OdsAnnotation AddAnnotation(string text, string? creator = null, DateTimeOffset? date = null, string? name = null)` [#](#method-addannotation-string-string-nullable-system-datetimeoffset-string)

[OdsCell.cs:244](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L244)

Adds an annotation to this cell.

Parameters

**text string required**

**creator string? = null optional**

**date System.DateTimeOffset? = null optional**

**name string? = null optional**

Returns

`OdsAnnotation`

`public void ClearValue()` [#](#method-clearvalue)

[OdsCell.cs:131](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L131)

Clears value content while retaining style, formula, validation, and annotations.

`public void SetBoolean(bool value)` [#](#method-setboolean-boolean)

[OdsCell.cs:177](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L177)

Sets a boolean value.

Parameters

**value bool required**

`public void SetCurrency(decimal value, string currencyCode)` [#](#method-setcurrency-decimal-string)

[OdsCell.cs:210](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L210)

Sets a currency amount and ISO currency code.

Parameters

**value decimal required**

**currencyCode string required**

`public void SetDate(DateTime value)` [#](#method-setdate-datetime)

[OdsCell.cs:186](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L186)

Sets a local date or date-time value.

Parameters

**value System.DateTime required**

`public void SetDateTime(DateTimeOffset value)` [#](#method-setdatetime-datetimeoffset)

[OdsCell.cs:193](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L193)

Sets an offset-aware date-time value.

Parameters

**value System.DateTimeOffset required**

`public void SetDecimal(decimal value)` [#](#method-setdecimal-decimal)

[OdsCell.cs:173](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L173)

Sets a decimal without a binary floating-point round trip.

Parameters

**value decimal required**

`public void SetDuration(TimeSpan value)` [#](#method-setduration-timespan)

[OdsCell.cs:202](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L202)

Sets a duration. ODF stores both time-of-day and duration values as ISO durations.

Parameters

**value System.TimeSpan required**

`public void SetHyperlink(string text, string href)` [#](#method-sethyperlink-string-string)

[OdsCell.cs:221](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L221)

Sets a hyperlink display value without fetching its target.

Parameters

**text string required**

**href string required**

`public void SetNumber(double value)` [#](#method-setnumber-double)

[OdsCell.cs:171](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L171)

Sets a double value.

Parameters

**value double required**

`public void SetPercentage(decimal value)` [#](#method-setpercentage-decimal)

[OdsCell.cs:205](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L205)

Sets a percentage from a fractional value, where 0.25 represents 25%.

Parameters

**value decimal required**

`public void SetString(string? value)` [#](#method-setstring-string)

[OdsCell.cs:139](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L139)

Sets a string value and display text.

Parameters

**value string? required**

`public void SetTime(TimeSpan value)` [#](#method-settime-timespan)

[OdsCell.cs:197](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L197)

Sets a time-of-day using the ODF duration representation.

Parameters

**value System.TimeSpan required**

`public bool TransformTextCase(OfficeTextCase textCase, CultureInfo? culture = null)` [#](#method-transformtextcase-officeimo-drawing-officetextcase-globalization-cultureinfo)

[OdsCell.cs:153](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L153)

Transforms stored string text while retaining the cell style.

Parameters

**textCase OfficeIMO.Drawing.OfficeTextCase required**

**culture System.Globalization.CultureInfo? = null optional**

Returns

`bool` true when a string value was transformed; otherwise false.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public bool IsCovered { get; }` [#](#property-iscovered)

[OdsCell.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L20)

True when this position is covered by a merged cell.

`public OdsCellValue Value { get; }` [#](#property-value)

[OdsCell.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L22)

Typed cached value.

`public string Text { get; }` [#](#property-text)

[OdsCell.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L24)

Decoded display text.

`public string? Formula { get; set; }` [#](#property-formula)

[OdsCell.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L27)

Raw OpenFormula expression, including any namespace prefix.

`public OdsAnnotation? Annotation { get; }` [#](#property-annotation)

[OdsCell.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L39)

The annotation attached to this cell, when present.

`public IReadOnlyList<OdsAnnotation> Annotations { get; }` [#](#property-annotations)

[OdsCell.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L41)

Annotation elements present on this cell. Conforming ODF permits at most one.

`public string? StyleName { get; set; }` [#](#property-stylename)

[OdsCell.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L44)

Referenced cell style name.

`public string? NumberFormatName { get; set; }` [#](#property-numberformatname)

[OdsCell.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L49)

Referenced number/date/time data style through the cell style.

`public string? ValidationName { get; set; }` [#](#property-validationname)

[OdsCell.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L54)

Referenced content validation rule.

`public bool? Bold { get; set; }` [#](#property-bold)

[OdsCell.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L59)

Explicit or inherited bold state.

`public bool? Italic { get; set; }` [#](#property-italic)

[OdsCell.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L64)

Explicit or inherited italic state.

`public bool? Underline { get; set; }` [#](#property-underline)

[OdsCell.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L68)

Explicit or inherited underline state.

`public OdfTextDecorationStyle? UnderlineStyle { get; set; }` [#](#property-underlinestyle)

[OdsCell.cs:70](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L70)

Explicit or inherited native underline pattern.

`public OdfTextDecorationType? UnderlineType { get; set; }` [#](#property-underlinetype)

[OdsCell.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L72)

Explicit or inherited underline line count.

`public bool? Strikethrough { get; set; }` [#](#property-strikethrough)

[OdsCell.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L74)

Explicit or inherited strikethrough state.

`public OdfTextDecorationStyle? LineThroughStyle { get; set; }` [#](#property-linethroughstyle)

[OdsCell.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L76)

Explicit or inherited native strikethrough pattern.

`public OdfTextDecorationType? LineThroughType { get; set; }` [#](#property-linethroughtype)

[OdsCell.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L78)

Explicit or inherited strikethrough line count.

`public OdfTextPosition? TextPosition { get; set; }` [#](#property-textposition)

[OdsCell.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L80)

Explicit or inherited baseline placement.

`public OdfTextTransform? TextTransform { get; set; }` [#](#property-texttransform)

[OdsCell.cs:82](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L82)

Explicit or inherited display-time case transformation.

`public bool? SmallCaps { get; set; }` [#](#property-smallcaps)

[OdsCell.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L84)

Explicit or inherited small-cap display formatting.

`public OdfLength? FontSize { get; set; }` [#](#property-fontsize)

[OdsCell.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L87)

Explicit or inherited font size.

`public string? FontFamily { get; set; }` [#](#property-fontfamily)

[OdsCell.cs:92](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L92)

Explicit or inherited font family.

`public OdfColor? Color { get; set; }` [#](#property-color)

[OdsCell.cs:97](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L97)

Explicit or inherited text color.

`public OdfColor? BackgroundColor { get; set; }` [#](#property-backgroundcolor)

[OdsCell.cs:103](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L103)

Explicit or inherited cell background color.

`public string? TextAlign { get; set; }` [#](#property-textalign)

[OdsCell.cs:110](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L110)

Explicit or inherited horizontal text alignment token.

`public string? TextAlignSource { get; set; }` [#](#property-textalignsource)

[OdsCell.cs:115](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L115)

Explicit or inherited table-cell horizontal alignment source token.

`public string? VerticalAlign { get; set; }` [#](#property-verticalalign)

[OdsCell.cs:120](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L120)

Explicit or inherited table-cell vertical alignment token.

`public string? WrapOption { get; set; }` [#](#property-wrapoption)

[OdsCell.cs:125](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsCell.cs#L125)

Explicit or inherited table-cell wrapping token.

<!-- PowerForge markdown artifact sha256:C9CEF4DB24AF3170819D57D45CF30E448133EEA82BAD13A4B3F82A7EF5AF2576 -->
