DataGrid

The DataGrid control allows you to interact with and edit the rows and columns of a Dataset in a customisable grid. See: DataGrid

Note that while the DataGrid control inherits much of the functionality of a Data View, including a date picker for Date fields, the following are not currently supported:

  • Picklists (the ability to select a lookup code from a list)
  • A special editor for Image BLOB fields

If this functionality is needed, use a Data View instead.

The Datasets pane shows the tables and fields you have defined for the form. The tables can be shown as a list or a hierarchy. You can hide or show the pane using a toggle button on the ribbon.

Fields or tables in the Datasets pane can be dragged and dropped directly onto the Design Sheet:

  • When you drag a dataset onto the Design Sheet, the dataset is automatically bound to a DataGrid.
  • When you drag a dataset field onto the Design Sheet, the dataset field is automatically bound to a control (the type of control that is bound to the field will depend on the data type of the field).
  • When you drag a dataset field onto the Design Sheet with CTRL and SHIFT, this creates a Label control with the name of the field and its Content (display text).

  • Use the ALT key after the drag and before the drop to place the control in a "container".

  • To add fields in a standard ‘form’ layout, select a Grid in the design canvas then, from the Dataset field list, use right-click to open the context menu which offers options for adding fields in a standard ’form’ layout.

The Field List menu for Form Datasets

Select the fields required in the sequence in which they should be displayed.

The Dataset Columns for Project dialog

This adds controls bound to the data with labels in the layout below:

Controls bound to data with labels

Scripting Syntax

The DataGrid control allows you to interact with and edit the rows and columns of a Dataset in a customisable grid. See: DataGrid

To navigate the rows and columns in the grid use the following scripting syntax:

    dataset = FormRuntime.Datasets[“NameofDataset”]
    dataset.CurrentIndex = 3
    dataset.MoveFirst()
    dataset.MoveBack()

To manipulate the rows and columns in the grid use the following syntax:

    dataset.RowChanged +- ...
    dataset.Add()
    dataset.Delete()
    dataset.Refresh

Bind a DataGrid to a Dataset

Navigate a Dataset