TX Text Control .NET for Windows Forms

IsValueValid Method

Method|Introduced in 28.0
Not found
No package of this release declares this member on this type or on a class it derives from.
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Returns a value indicating whether the value of a specific form field is marked as valid. The corresponding validation is executed by the conditions of a conditional instruction and applied by an Instruction object, that marks the related form field as valid or invalid.

Syntax

No package of this release declares this member. The declaration below is the reference's, and code that uses it does not compile.

public bool IsValueValid(FormField formField);

Parameters

ParameterDescription
formField

Specifies the FormField that is checked.

Return Value

The return value is false, if a conditional instruction is applied that has marked the form field value as invalid. If such conditional instruction was not defined or a conditional instruction has marked the form field value as valid, the method returns true.

Examples

In TX Text Control 34, HasValidValue is the current name of this validation operation. The following example highlights a form field when its conditional rules do not accept the current value.

FormField formField = textControl.FormFields.GetItem();
if (formField != null &&
    !textControl.FormFields.ConditionalInstructions.HasValidValue(formField))
{
    formField.HighlightMode = HighlightMode.Always;
}