Fernando Cerqueira Web Site
Consultor,Arquiteto de Aplicações,Especialista Microsoft .NET
Friday, July 30, 2010
CompareValidator Demonstration
Dependency Properties

CultureInput: CultureInfo to compare values. Default value is thread culture Current.

DataType: Data type to compare.

  • String
  • Integer
  • Double
  • Date
  • Time

TimeType: Time type to compare when DataType is Time.

  • Hours12: Min. 0 and Max. 12.
  • Hours24: Min. 0 and Max. 23.

ValueToCompare: The constant value to compare with the value entered by the user in the input control being validated.

ControlToCompare: The input control to compare with the input control being validated.

PropertyControlToCompare: The property name of control to compare.If empty, Only TextBox, TextBlock and PasswordBox Controls are valids. The value of property is converted to string.

Operator: the comparison operation to perform.

  • Equal: A comparison for equality between the values of the input control being validated and another control, or a constant value.
  • NotEqual: A comparison for inequality between the values of the input control being validated and another control, or a constant value.
  • GreaterThan: A comparison for greater than between the values of the input control being validated and another control, or a constant value.
  • GreaterThanEqual: A comparison for greater than or equal to between the values of the input control being validated and another control, or a constant value.
  • LessThan: A comparison for less than between the values of the input control being validated and another control, or a constant value.
  • LessThanEqual: A comparison for less than between the values of the input control being validated and another control, or a constant value.
  • DataTypeCheck: A data type comparison of the value entered in the input control being validated and the data type specified. Validation fails if the value cannot be converted to the specified data type. Note: The ControlToCompare and ValueToCompare properties are ignored when this operator is used.