Accessing the properties of a DataWindow object

About DataWindow object properties

DataWindow object properties store the information that controls the behavior of a DataWindow object. They are not properties of the DataWindow control, but of the DataWindow object displayed in the control. The DataWindow object is itself made up of individual controls—column, text, graph, and drawing controls—that have DataWindow object properties.

You establish initial values for DataWindow object properties in the DataWindow painter. You can also get and set property values at runtime in your code.

You can access the properties of a DataWindow object by using the Describe and Modify methods or DataWindow property expressions. Which you use depends on the type of error checking you want to provide and on whether you know the names of the controls within the DataWindow object and properties you want to access when the script is compiled.

For lists and descriptions of DataWindow object properties, see the DataWindow Reference in the online Help.

Using methods to access object properties

You can use the following methods to work with the properties of a DataWindow object:

For example, the following statements assign the value of the Border property for the empname column to a string variable:

string ls_border
ls_border = dw_1.Describe("empname.Border")

The following statement changes the value of the Border property for the empname column to 1:

dw_emp.Modify("empname.Border=1")

NoteAbout dynamic DataWindow objects Using Describe and Modify, you can provide an interface through which application users can alter the DataWindow object at runtime. For example, you can change the appearance of a DataWindow object or allow an application user to create ad hoc reports.

For more information, see Chapter 10, “Dynamically Changing DataWindow Objects.”

Using expressions

DataWindow property expressions provide access to properties with fewer nested strings. In PocketBuilder, you can handle problems with incorrect object and property names in the Error event.

Use the Object property and dot notation. For example:

integer li_border
li_border = Integer(dw_1.Object.empname.Border)
dw_1.Object.empname.Border = 1