What you can do with DataWindow object properties

The DataWindow object defines the way data is displayed in a DataWindow control. (Here DataWindow control is used to mean a DataWindowControl, WebDataWindowControl, or DataStore). It contains controls that represent the columns, text labels, computed fields, and images.

The properties of the DataWindow object and its controls store the information that specifies the behavior of the DataWindow object. They are not properties of the DataWindow control, but of the DataWindow object displayed in the control.

NoteTerminology When you are programming for DataWindows, there are several types of expressions involved.

A DataWindow expression is an expression assigned as a value to a DataWindow property and is evaluated by the DataWindow engine. The expression can refer to column data and can have a different value for each row in the DataWindow object.

A DataWindow property expression is an expression in your code that gets or sets the value of a DataWindow object property. Its effects are equivalent to what the Describe and Modify methods do.

Types of values

Property values can be constants or they can be DataWindow expressions. DataWindow expressions allow the property value to be based on other conditions in the DataWindow, including data values. Conditional expressions based on data can give the property a different value for each row.

Getting and setting values

You establish initial values for properties in the DataWindow painter. You can also get and set property values at runtime in code in both an early-binding and a late-binding fashion. For more information, see “Accessing DataWindow object property values in code”.

There are several techniques for accessing property values. A particular property might be accessible by a subset of those techniques. For example, some properties are read-only at runtime, some can be set only at runtime, and some accept only constants (not DataWindow expressions) as values.

For a complete list of properties and the ways you can access each one, see the DataWindow Object Reference.

Examples: ways of setting the Border property

This table lists the ways you can access a property, using the Border property as an example:

Table 6-1: Ways to access and change DataWindow object properties

What you can do with properties

How to do it, using the Border property as an example

What happens

Set the initial value of the property in the workspace

Property page, General tab, Border box

The Border property takes on the value you set unconditionally. In the Preview view and at runtime, the control has the border you indicated in the workspace unless you set the Border property again in some way.

Specify the value of the property at runtime based on an expression defined for the control in the workspace

Property page, General tab, Border box, Expression button

In Preview and at runtime, the border changes as specified in the expression, which overrides the setting on the property page.

For example, an expression can give the Salary column value a ShadowBox border when the salary exceeds $70,000.

To see the effect in the Preview view, you might need to close Preview and reopen it.

Get the value of the property at runtime in code

Describe or GetProperty method, or GraphicObjectColumn BorderStyle.Value and BorderStyle.Expression properties

Returns the value of the Border property for the specified control.

Change the value of the property at runtime in code

Modify or SetProperty method, or GraphicObjectColumn BorderStyle.Value and BorderStyle.Expression properties

At runtime, the value of the property changes when the code executes. For example, you could code Modify in the Clicked event and change the border of the control the user clicked.

You can also set the initial value of the property at runtime in code for a DataWindow being created using the DataWindowSyntaxFromSql method. When DataWindowSyntaxFromSql executes, the border value of all columns is set in the generated syntax.