Data.DB.TBooleanField.DisplayValues

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property DisplayValues: string read FDisplayValues write SetDisplayValues;

C++

__property System::UnicodeString DisplayValues = {read=FDisplayValues, write=SetDisplayValues};

Properties

Type Visibility Source Unit Parent
property published
Data.DB.pas
Data.DB.hpp
Data.DB TBooleanField

Description

Controls how the Boolean field is translated to and from display format.

Use DisplayValues to specify strings used by the field to represent Boolean values. Use any pair of phrases, separated by a semicolon.

Examples

To have the true and false values correspond to the letters T and F, respectively, set DisplayValues as follows:

  ClientDataSet1LogicalField.DisplayValues := 'T;F';
  ClientDataSet1LogicalField->DisplayValues = "T;F";

Similarly, to set the values of true and false to the strings Yes and No, set DisplayValues as follows:

 ClientDataSet1LogicalField.DisplayValues := 'Yes;No';
 ClientDataSet1LogicalField ->DisplayValues = "Yes;No";

The string associated with true or false can be an empty string. To set the value for true to an empty string, set DisplayValues to a string that begins with a semicolon (;). For example, to associate false with the string Fail, and true with an empty string, set DisplayValues to:

 ClientDataSet1LogicalField.DisplayValues := ';Fail';
 ClientDataSet1LogicalField ->DisplayValues = ";Fail";

To associate false with an empty string, set DisplayValues to the string for true, with no semicolon at all.

The strings associated with true and false by DisplayValues appear in data-aware controls when they display the data for a Boolean field. If one of the strings is an empty string, boolean values associated with that string appear blank in data-aware controls.

These strings are also used when getting or setting the Boolean field's AsString property.

See Also