Partager via


How to: Configure Browse Windows or Grids

You can change the configuration of a browse window or grid in the following ways:

  • Rearranging Columns

  • Changing Column Widths

  • Fitting Columns to Data Automatically

  • Turning Grid Lines On and Off

  • Splitting a Browse window

  • Locking Columns

For more information, see Browse Window and Grid Control.

Rearranging Columns

You can rearrange columns in the order you want.

Note

Rearranging columns does not affect the actual structure of the table.

To rearrange a column in a browse window

  1. Open the table in a browse window.

  2. Insert the cursor in the column you want to move.

  3. On the Table menu, click Move Field.

    The cursor changes shape to indicate you can move the column.

  4. To move the column, press the LEFT ARROW or RIGHT ARROW keys.

  5. When you are finished, press the ENTER key.

You can also drag the column header to the new location.

To rearrange a column in a grid

  • Drag the column header to the new location.

Changing Column Widths

You can change the width of a column.

Note

Resizing the column width does not affect the field length or the structure of the table. To change the actual length of the fields, modify the structure of the table using the Table Designer.

To change the width of a column in a browse window

  1. Open the table in a browse window.

  2. Insert the cursor in a column you want to resize.

  3. On the Table menu, click Size Field.

    The cursor changes shape to indicate you can resize the column.

  4. To increase the size of the column, press the RIGHT ARROW key. To decrease it, press the LEFT ARROW key.

  5. When you are finished, press the ENTER key.

You can also drag between column headers to resize the column to the left of the cursor.

To change the width of a column in a grid

  • Drag between the column headers to resize the column to the left of the cursor.

Fitting Columns to Data Automatically

You can resize columns to automatically fit the data that they contain.

To resize one column to data

  • Double-click between the column headers to the right of the column you want to resize automatically.

To resize all columns to data

  • Double-click the area to the left of the first column header.

Turning Grid Lines On and Off

You can turn off the grid lines in a browse window.

To turn grid lines on or off

  1. Open the table in a browse window.

  2. On the View menu, click Grid Lines.

Splitting a Browse Window

You can split the browse window into left and right windows so you can look at two different areas in the table or look at records in browse and edit modes at the same time.

Tip

By default, the two windows of a split browse window are linked. When you select and modify records in one window, your changes are reflected in the other window. If you want the two windows to function independently, for example, so you can scroll one pane without affecting the other, click Link Partitions on the Table menu so that it is not selected.

To split a browse window

  1. Open the table in a browse window.

  2. On the Table menu, click Resize Partitions.

    The cursor changes shape to indicate that you can split the browse window.

  3. To increase the size of the left browse window, press the RIGHT ARROW key. To decrease the size, press the LEFT ARROW key.

  4. When you are finished, press the ENTER key.

You can also position the cursor in the dark area at the bottom left corner of the browse window and drag the corner to increase the size of the left browse window.

To resize a split browse window, perform the same steps to split a browse window.

Locking Columns

You display only certain columns while you scroll through the table by locking those columns. For example, pressing the TAB key to move through columns to the right does not cause locked columns to scroll out of the browse window or grid.

To lock all columns to the left of a column

  • Right-click the area between the column headers to the right of the column you want to lock.

A vertical column separator line, which appears 1 pixel wider than the line separating the other columns, indicates the area where the locked columns end and the normal columns begin.

To unlock all columns

  • Right-click between any column headers.

All columns are unlocked.

Note

When any of columns scroll to the left out of view and are locked, they remain hidden until locking is removed. This functionality can be useful if you want to lock the columns in the middle of the grid and do not want to display the preceding or following columns. The Column SetFocus method does not function if a column is locked and hidden from view, for example, scrolled off to the left side. For more information, see SetFocus Method.

For example, suppose a grid contains five columns, and the data source has ten columns. When you scroll two columns to the right, the first and second columns scroll to the left and out of view. When you right-click the column header the first and second visible columns, which are actually the third and fourth columns, the first two hidden columns as well as the first visible column become locked. However, you cannot scroll to the left to view all the locked columns.

See Also

Tasks

How to: View Records in Tables

How to: Navigate Records in Tables

How to: Filter Records in Tables

Other Resources

Working with Tables (Visual FoxPro)

Working with Records