ExcelRangeDataValidationBuilder
OfficeIMO.Excel
Adds data validation rules to an ExcelRange.
Inheritance
- object
- ExcelRangeDataValidationBuilder
Remarks
Existing rules are listed, edited and removed through the worksheet (ExcelSheet.GetDataValidations, ExcelSheet.SetDataValidationMessages, ExcelSheet.UpdateDataValidationMessages, ExcelSheet.RemoveDataValidations).
Usage
Explore 1 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 1
- Method ExcelRange.Validation
Methods
public ExcelRange CustomFormula(string formula, bool allowBlank = true, string? errorTitle = null, string? errorMessage = null) #Accepts input when a custom formula evaluates to true.
Parameters
- formula string
- allowBlank bool = true
- errorTitle string? = null
- errorMessage string? = null
Returns
ExcelRangepublic ExcelRange Date(ExcelDataValidationOperator operator, DateTime formula1, DateTime? formula2 = null, bool allowBlank = true, string? errorTitle = null, string? errorMessage = null) #Restricts input to dates; Between and NotBetween need formula2.
Parameters
- operator OfficeIMO.Excel.ExcelDataValidationOperator
- formula1 System.DateTime
- formula2 System.DateTime? = null
- allowBlank bool = true
- errorTitle string? = null
- errorMessage string? = null
Returns
ExcelRangepublic ExcelRange Decimal(ExcelDataValidationOperator operator, double formula1, double? formula2 = null, bool allowBlank = true, string? errorTitle = null, string? errorMessage = null) #Restricts input to decimal numbers; Between and NotBetween need formula2.
Parameters
- operator OfficeIMO.Excel.ExcelDataValidationOperator
- formula1 double
- formula2 double? = null
- allowBlank bool = true
- errorTitle string? = null
- errorMessage string? = null
Returns
ExcelRangepublic ExcelRange List(params string[] items) #Restricts input to a drop-down list of inline items.
Parameters
- items string[]
Returns
ExcelRangepublic ExcelRange List(IEnumerable<string> items, bool allowBlank = true) #Restricts input to a drop-down list of inline items.
Parameters
- items System.Collections.Generic.IEnumerable<string>
- allowBlank bool = true
Returns
ExcelRangepublic ExcelRange ListNamedRange(string namedRange, bool allowBlank = true) #Restricts input to a drop-down list read from a workbook or sheet-local named range.
Parameters
- namedRange string
- allowBlank bool = true
Returns
ExcelRangepublic ExcelRange ListRange(string sourceA1Range, string? sourceSheetName = null, bool allowBlank = true) #Restricts input to a drop-down list read from a worksheet range; the current sheet when no sheet is named.
Parameters
- sourceA1Range string
- sourceSheetName string? = null
- allowBlank bool = true
Returns
ExcelRangepublic ExcelRange TextLength(ExcelDataValidationOperator operator, int formula1, int? formula2 = null, bool allowBlank = true, string? errorTitle = null, string? errorMessage = null) #Restricts the length of text input; Between and NotBetween need formula2.
Parameters
- operator OfficeIMO.Excel.ExcelDataValidationOperator
- formula1 int
- formula2 int? = null
- allowBlank bool = true
- errorTitle string? = null
- errorMessage string? = null
Returns
ExcelRangepublic ExcelRange Time(ExcelDataValidationOperator operator, TimeSpan formula1, TimeSpan? formula2 = null, bool allowBlank = true, string? errorTitle = null, string? errorMessage = null) #Restricts input to times of day; Between and NotBetween need formula2.
Parameters
- operator OfficeIMO.Excel.ExcelDataValidationOperator
- formula1 System.TimeSpan
- formula2 System.TimeSpan? = null
- allowBlank bool = true
- errorTitle string? = null
- errorMessage string? = null
Returns
ExcelRangepublic ExcelRange WholeNumber(ExcelDataValidationOperator operator, int formula1, int? formula2 = null, bool allowBlank = true, string? errorTitle = null, string? errorMessage = null) #Restricts input to whole numbers; Between and NotBetween need formula2.
Parameters
- operator OfficeIMO.Excel.ExcelDataValidationOperator
- formula1 int
- formula2 int? = null
- allowBlank bool = true
- errorTitle string? = null
- errorMessage string? = null
Returns
ExcelRange