Adding, Removing, and Rearranging Columns

See Also

The DataGrid control provides a columns editor to add, remove, and rearrange the columns in the grid. By default, each field in the underlying recordset is bound to a column in the grid, and the columns are ordered according to the fields in the recordset.

To add, remove, and rearrange columns in the grid

  1. To open the columns editor, click the DataGrid control's columns property in the Properties window. Then click the ellipses (...) button.

  2. To add a column, click Add.

    Note   The column that is added is initially unbound. To bind the column, set its boundFieldName property to the name of a field in the recordset. (For information about how to access column properties, see Accessing Column Properties.)

  3. To remove a column, select the column in the list and click Remove.

    Note   If you simply want to hide the column temporarily rather than completely remove it from the grid, set its visible property to false.

  4. To rearrange columns, select the column you want to move and click Up or Down.

  5. Click OK when you have finished adding, removing, or rearranging columns.