DataValidations Class
Data Validations.When the object is serialized out as xml, its qualified name is x:dataValidations.
Inheritance Hierarchy
System.Object
DocumentFormat.OpenXml.OpenXmlElement
DocumentFormat.OpenXml.OpenXmlCompositeElement
DocumentFormat.OpenXml.Spreadsheet.DataValidations
Namespace: DocumentFormat.OpenXml.Spreadsheet
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
Syntax
'Declaration
<ChildElementInfoAttribute(GetType(DataValidation))> _
Public Class DataValidations _
Inherits OpenXmlCompositeElement
'Usage
Dim instance As DataValidations
[ChildElementInfoAttribute(typeof(DataValidation))]
public class DataValidations : OpenXmlCompositeElement
Remarks
The following table lists the possible child types:
- DataValidation <x:dataValidation>
[ISO/IEC 29500-1 1st Edition]
18.3.1.33 dataValidations (Data Validations)
This collection expresses all data validation information for cells in a sheet which have data validation features applied.
Data validation is used to specify constraints on the data that can be entered into a cell. Additional UI can be provided to help the user select values (e.g., a dropdown control on the cell or hover text when the cell is active), and to help the user understand why a particular entry was disallowed (e.g., alerts and messages).
Various data types can be selected, and logical operators (e.g., greater than, less than, equal to, etc) can be used. Additionally, instead of specifying an explicit set of values that are permitted, a cell or range reference can be used.
An input message can be specified to help the user know what kind of value is expected, and a warning message (and warning type) can be specified to alert the user when they've entered data which is not permitted based on the data validations specified in the worksheet.
[Example:
<dataValidations count="1">
<dataValidation type="whole" errorStyle="warning" operator="greaterThan"
showInputMessage="1" showErrorMessage="1" errorTitle="Invalid Data"
error="The value must be a whole number greater than 0."
promptTitle="Whole Number"
prompt="Please enter a whole number greater than 0." sqref="A1">
<formula1>0</formula1>
</dataValidation>
</dataValidations>
end example]
Parent Elements |
---|
worksheet (§18.3.1.99) |
Child Elements |
Subclause |
---|---|
dataValidation (Data Validation) |
§18.3.1.32 |
Attributes |
Description |
---|---|
count (Data Validation Item Count) |
The expected number of data validation items for this worksheet. The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype. |
disablePrompts (Disable Prompts) |
A boolean value indicating whether all input prompts for the worksheet are disabled. The possible values for this attribute are defined by the W3C XML Schema boolean datatype. |
xWindow (Top Left Corner (X Coodrinate)) |
The x-coordinate (relative to window) of top-left corner of the data validation input prompt (textbox). This is per sheet, not per cell. Units in pixels. The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype. |
yWindow (Top Left Corner (Y Coordinate)) |
The y-coordinate (relative to window) of top-left corner of the data validation input prompt (textbox). This is per sheet, not per cell. Units in pixels. The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype. |
[Note: The W3C XML Schema definition of this element’s content model (CT_DataValidations) is located in §A.2. end note]
© ISO/IEC29500: 2008.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.