New to Telerik Document ProcessingStart a free 30-day trial

Validates that cell input matches one of the values in a specified list or range.

Definition

Constructors

Initializes a new ListDataValidationRule with the specified list source and dropdown settings.

C#
public ListDataValidationRule(ListDataValidationRuleContext context)
Parameters:contextListDataValidationRuleContext

The context.

Methods

Determines whether the specified object is equal to the current object.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with the current object.

Returns:

bool

true if the specified object is equal to the current object; otherwise, false.

Overrides: SingleArgumentDataValidationRuleBase.Equals(object)

Evaluates whether the specified cell value matches any item in the list.

C#
protected override bool EvaluateOverride(Worksheet worksheet, int rowIndex, int columnIndex, ICellValue cellValue)
Parameters:worksheetWorksheet

The worksheet.

rowIndexint

Index of the row.

columnIndexint

Index of the column.

cellValueICellValue

The cell value.

Returns:

bool

Retrurns True if the rule is satisfied, else returns False.

Overrides: DataValidationRuleBase.EvaluateOverride(Worksheet, int, int, ICellValue)

Extracts the list items defined by this rule for the specified cell location.

C#
public IEnumerable<string> ExtractListItems(Worksheet worksheet, CellIndex cellIndex)
Parameters:worksheetWorksheet

The worksheet.

cellIndexCellIndex

Index of the cell.

Returns:

IEnumerable<string>

Extracts the list items defined by this rule for the specified cell location.

C#
public IEnumerable<string> ExtractListItems(Worksheet worksheet, int rowIndex, int columnIndex)
Parameters:worksheetWorksheet

The worksheet.

rowIndexint

Index of the row.

columnIndexint

Index of the column.

Returns:

IEnumerable<string>

Serves as a hash function for a particular type.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: SingleArgumentDataValidationRuleBase.GetHashCode()

Properties

Controls whether a dropdown arrow appears in the cell to display available list values.

C#
public bool InCellDropdown { get; set; }
Property Value:

The a value indicating if an cell dropdown should be shown.