# OdsValidation

An XML-backed spreadsheet content validation rule.

Class 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OdsNamedRange.cs:98](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L98)

**Modifiers**

sealed

An XML-backed spreadsheet content validation rule.

## Inheritance

- object
- OdsValidation

## 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 [OdsDocument.AddValidation](/api/open-document/officeimo-opendocument-odsdocument/#method-addvalidation-string-string-boolean)
- Property [OdsDocument.Validations](/api/open-document/officeimo-opendocument-odsdocument/#property-validations)

Filter members 

Show inherited

## Methods

`public void EnsureErrorMessage(OdsValidationMessageType messageType = Stop, bool display = true)` [#](#method-ensureerrormessage-officeimo-opendocument-odsvalidationmessagetype-boolean)

[OdsNamedRange.cs:119](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L119)

Ensures an error-message element exists even when it has no title or body.

Parameters

**messageType OfficeIMO.OpenDocument.OdsValidationMessageType = Stop optional**

**display bool = true optional**

`public void EnsureHelpMessage(bool display = true)` [#](#method-ensurehelpmessage-boolean)

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

Ensures an input-help element exists even when it has no title or body.

Parameters

**display bool = true optional**

`public void SetErrorMessage(string? title, string? text, OdsValidationMessageType messageType = Stop, bool display = true)` [#](#method-seterrormessage-string-string-officeimo-opendocument-odsvalidationmessagetype-boolean)

[OdsNamedRange.cs:112](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L112)

Sets the optional error shown when the entered value fails validation.

Parameters

**title string? required**

**text string? required**

**messageType OfficeIMO.OpenDocument.OdsValidationMessageType = Stop optional**

**display bool = true optional**

`public void SetHelpMessage(string? title, string? text, bool display = true)` [#](#method-sethelpmessage-string-string-boolean)

[OdsNamedRange.cs:98](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L98)

Sets the optional input help shown when a validated cell is selected.

Parameters

**title string? required**

**text string? required**

**display bool = true optional**

## 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 string Name { get; }` [#](#property-name)

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

Validation name.

`public string Condition { get; set; }` [#](#property-condition)

[OdsNamedRange.cs:57](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L57)

Preserved ODF validation condition.

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

[OdsNamedRange.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L62)

Absolute sheet-qualified base cell used to evaluate relative references in the condition.

`public OdsValidationConditionSyntax? ParsedCondition { get; set; }` [#](#property-parsedcondition)

[OdsNamedRange.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L67)

Typed interoperable condition, or null when the preserved expression is implementation-specific.

`public bool AllowEmptyCell { get; set; }` [#](#property-allowemptycell)

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

Whether empty cells satisfy the rule.

`public OdsValidationDisplayList DisplayList { get; set; }` [#](#property-displaylist)

[OdsNamedRange.cs:79](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L79)

How list-validation values are displayed. ODF defaults to [OdsValidationDisplayList.Unsorted](/api/open-document/officeimo-opendocument-odsvalidationdisplaylist/).

`public string? HelpTitle { get; }` [#](#property-helptitle)

[OdsNamedRange.cs:124](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L124)

Input-help title, if present.

`public bool HasHelpMessage { get; }` [#](#property-hashelpmessage)

[OdsNamedRange.cs:127](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L127)

Whether an input-help element is present.

`public string? HelpText { get; }` [#](#property-helptext)

[OdsNamedRange.cs:129](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L129)

Input-help text, if present.

`public bool ShowHelpMessage { get; }` [#](#property-showhelpmessage)

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

Whether input help is displayed.

`public string? ErrorTitle { get; }` [#](#property-errortitle)

[OdsNamedRange.cs:133](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L133)

Validation-error title, if present.

`public bool HasErrorMessage { get; }` [#](#property-haserrormessage)

[OdsNamedRange.cs:136](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L136)

Whether a validation-error element is present.

`public string? ErrorText { get; }` [#](#property-errortext)

[OdsNamedRange.cs:138](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L138)

Validation-error text, if present.

`public bool ShowErrorMessage { get; }` [#](#property-showerrormessage)

[OdsNamedRange.cs:140](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L140)

Whether validation errors are displayed.

`public OdsValidationMessageType ErrorMessageType { get; }` [#](#property-errormessagetype)

[OdsNamedRange.cs:144](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsNamedRange.cs#L144)

Validation-error severity.

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