RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TBooleanField.DisplayValues Property

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

Pascal
property DisplayValues: string;
C++
__property AnsiString DisplayValues;

Use DisplayValues to specify strings the field uses to represent Boolean values. Use any pair of phrases, separated by a semicolon. For example, to have the true and false values correspond to the letters T and F, respectively, set DisplayValues as follows: 

On Windows:

Table1LogicalField.DisplayValues := 'T;F';

On cross-platform:

ClientDataSet1LogicalField.DisplayValues := 'T;F';

On Windows:

Table1LogicalField->DisplayValues = "T;F";

On cross-platform:

ClientDataSet1LogicalField->DisplayValues = "T;F";

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

On Windows:

Table1LogicalField.DisplayValues := 'Yes;No';

On cross-platform:

ClientDataSet1LogicalField.DisplayValues := 'Yes;No';

On Windows:

Table1LogicalField ->DisplayValues = "Yes;No";

On cross-platform:

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: 

On Windows:

Table1LogicalField.DisplayValues := ';Fail';

On cross-platform:

ClientDataSet1LogicalField.DisplayValues := ';Fail';

On Windows:

Table1LogicalField ->DisplayValues = ";Fail";

On cross-platform:

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. 

 

AsString

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!