Share via


How to: Set the Source of the Data Displayed in the Grid

You can set the data source for the grid and for each column individually.

To set the data source for a grid

  1. Select the grid, and then click the RecordSourceType property in the Properties Window (Visual FoxPro).

  2. Set the RecordSourceType property to 0 - Table, if you want Visual FoxPro to open the table for you, or 1 - Alias if you want the grid to be populated with the fields in a table that is already open.

  3. Click the RecordSource property in the Properties window.

  4. Type the name of the alias or table to serve as the data source for the grid.

If you want to specify particular fields to be displayed in particular columns, you also can set the data source for a column.

To set the data source for a column

  1. Select the column, and then click the ControlSource property in the Properties Window (Visual FoxPro).

  2. Type the name of the alias or table and the field to serve as the source for the values displayed in the column. For example, you can type:

    Orders.order_id
    

See Also

Tasks

How to: Manually Adjust Grid Display at Design Time

How to: Set Up a One-to-Many Form Using the Grid Control

How to: Display Controls in Grid Columns

Concepts

Formatting Grids

Controls and Objects Created in Earlier Versions

Reference

Controls for Manipulating Rows of Data

Other Resources

Using Controls