MindFusion.Wpf Pack Programmer's Guide
IValidation Interface
Remarks See Also
 





Represents data validation associated with a range of cells.

Namespace: MindFusion.Spreadsheet.Wpf
Assembly: MindFusion.Spreadsheet.Wpf

 Syntax

C#  Copy Code

public interface IValidation

Visual Basic  Copy Code

Public Interface IValidation

 Remarks

This interface is used to validate user input in a cell or range of cells. There are several types of validations that can be used, as specified by the Type property.

To display a popup message when a cell associated with the validation is selected, set the ShowInputMessage property to true and customize the input message through the InputTitle and InputMessage properties. The ErrorAction property determines what happens when the validation fails. The control can display a warning, an error message, or simply raise an event.

The different validation types and their required operands are discussed in more details below.

All values

This validation type indicates that the validation will always be successful and is effectively the same as no validation.

Date, Time, Decimal, and Whole number

The validation compares the input value to the values specified by First and Second using the operator specified by Operator. The input value should be numeric and the operands should be convertible to numbers. In the WholeNumber case, the input value should also be a whole number. The following table illustrates the valid operators for this validation type and how the two operands are used by each operator.

Operator

Validation

Between

The input value must be greater than or equal to First and less than or equal to Second.

NotBetween

The input value must be less than First or greater than Second.

Equal / NotEqual

The input value must be equal / not equal to First. Second is not used.

LessThan / LessThanOrEqual

The input value must be less than / less than or equal to First. Second is not used.

GreaterThan / GreaterThanOrEqual

The input value must be greater than / greater than or equal to SecondFirst is not used.

Text

The validation compares the input to the value specified by First using the operator specified by Operator. Second is not used. The operand should be convertible to a string. The following table illustrates the valid operators for this validation type.

Operator

Validation

Contain / NotContain

The input value must contain / not contain First.

Equal / NotEqual

The input value must be equal / not equal to First.

Text length

The validation compares the length of the input to the value specified by First and Second using the operator specified by Operator, following rules similar to those used when validating numeric values (see above).

List

The validation compares the input value to a list of values obtained from First. First can be a string, containing a comma-delimited list of values. Alternatively, First can be an expression that evaluates to a string with comma-delimited values, or to a cell reference. In the later case the list is composed of the values of all cells in the referenced range.

 See Also

IValidation Members
MindFusion.Spreadsheet.Wpf Namespace