Storing data in a DataWindow object using the Data view

Usually you retrieve data into a DataWindow object from the database, because the data is changeable and you want the latest information. However, sometimes the data you display in a DataWindow object never changes (as in a list of states or provinces), and sometimes you need a snapshot of the data at a certain point in time. In these situations, you can store the data in the DataWindow object itself. You do not need to go out to the database or other data source to display the data.

The most common reason to store data in a DataWindow object is for use as a drop-down DataWindow where the data is not coming from a database. For example, you might want to display a list of postal codes for entering values in a State or Province column in a DataWindow object. You can store those codes in a DataWindow object and use the DropDownDataWindow edit style for the column.

StepsTo store data in a DataWindow object:

  1. If the Data view is not already displayed, select View>Data from the menu bar.

    In the default layout for the DataWindow editor, the Data view displays in a stacked pane under the Properties view. All columns defined for the DataWindow object are listed at the top.

  2. Do any of the following:

    NoteData changes are local to the DataWindow object Adding or deleting data here does not change the data in the database. It only determines what data will be stored with the DataWindow object when you save it.

  3. When you have finished, save the DataWindow object.

When you save the DataWindow object, the data is stored in the DataWindow object.

Sharing data with the Preview view

To see changes you make in the Data view reflected in the Preview view, select ShareData from the pop-up menu in the Data view. The Preview view shows data from the storage buffer associated with the Data view.

Saving the DataWindow object without data

If you saved the DataWindow object with data to obtain a snapshot, you usually need to save it again without data. To do so, select Delete All Rows from the pop-up menu in the Data view before saving.

NoteSharing DataWindow objects with other developers Storing data in a DataWindow object is a good way to share data and its definition with other developers. They can simply open the DataWindow object on their computers to get the data and all its properties.