CompareValidator (Angular)

This guide demonstrates how to use the CompareValidator component.

The CompareValidator will show its Text property unless the value of its Component is equal to a specified value or the value of another component.

CompareValidator Properties

Name Type Default Description
Name string ‘compareValidator’ + index suffix Unique name of CompareValidator.
Text string ‘Value should match’ The text that the validator will display.
Component string null The Name of a input component.
ComponentToCompare string null The Name of a input component to compare with.
Visible boolean/expression true Is the CompareValidator visible.

Usage

The CompareValidator is used to verify that value of an input component (e.g. TextBox, DropDown) matches some other value - either a predefined one or the value of another component.

  1. Drag and drop a CompareValidator from the Radzen toolbox.
  2. Set its Component property via the dropdown.
  3. Either set the Value property or the ComponentToCompare property.