Choices Property

Gets or sets the available choices for this object.

object.Choices = [string]

Where object is an object expression that evaluates to one of the controls in the Applies To list, and string is a string expression specifying the field choices for the selected and unselected state of the control.

Note that string must be in the following format, with a semicolon separating the checked and unchecked values: <Checked value>;<Unchecked value>.

Client support

   Newlook Smartclient

   Newlook Server

Use

This property specifies the underlying checked and unchecked values of a check box control or, in the case of data grid columns, a cell defined as a check box type.

If the Choices property is blank, then the Value property will return 0 when the checkbox is unchecked, 1 when the checkbox is checked, or 2 if the check box is tri-state and the state is unknown.

If the Choices property contains a pair of semi-colon delimited choices, then Value will return the second choice in the pair when unchecked, the first choice in the pair when checked, or an empty string if the checkbox is tri-state and the state is unknown.

Example:

If the Choices property contains the choices Yes;No and the checkbox is currently selected, then the Value property will return Yes. If the checkbox is unselected, it will return No. If the Tristate property has been set to True and the grayed state is selected, then the Value property will return an empty string.

If the Choices property contains a single value instead of a pair of options, this value represents the selected state of the checkbox, the unchecked and grayed state will both return an empty string.

tip

This property is only applied in the data grid control if the column's Type property has been set to CheckBox. If the column type has been set to anything else, this property will be ignored.

be aware that:

If you are binding a check box control to a buddy host control, you will need to specify a valid semi-colon delimited pair of choices in the BuddyValue property, to ensure that the correct value is sent through to the host.

See Also

TriState property | Value property | BuddyValue property

Applies To

Check box control

Datagrid Column Object