Configure a data grid

Configure a data grid

Configure a data grid to display data from a project node or a database.
  1. In
    Project view
    , in
    UI
    , right-click a container and then select
    New
    Data controls
    Data grid
    .
  2. In
    Properties
    , either:
    • Create a dynamic link between the
      Model
      property and a project node. This obtains values of attributes or properties of all direct child nodes.
      For example, select the
      Model
      folder with objects that contain data. For more information, see Project nodes.
    • Create a dynamic link between the
      Model
      property and a database object. This obtains data contained in database tables.
      For example, select an Embedded, ODBC, or InfluxDB database object. For more information, see Database.
    For more information about dynamic links, see Create dynamic links.
  3. (optional) Specify the kind of items to display in the object by setting
    ItemKind
    .
    TIP:
    The
    ItemKind
    property is automatically set with the object or variable type recognized among the child nodes.
    For example, if the model is based on a folder node that contains several instances of a
    Motor
    object type,
    ItemKind
    is automatically set with the reference to the
    Motor
    type. In this case, the values that display are the attributes or properties of different instances (
    Motor1
    ,
    Motor2
    ,
    Motor3
    , and so on).
  4. (optional) In
    Query
    , enter a standard SQL query to filter items obtained from a database or project nodes as specified in
    Model
    .
    For more information, see SQL queries.
    For example:
    SELECT * FROM Model WHERE SPEED > 40
    SELECT * FROM "DataLogger1" WHERE Speed > 40
  5. (optional) Create a dynamic link between
    Selected item
    and the item to be selected by default.
    For more information about dynamic links, see Create dynamic links.
  6. (optional) Set
    Allow deselection
    to
    True
    to enable clearing of selected items in the object.
  7. Add columns to the grid by selecting
    Add
    next to
    Columns
    .
  8. Configure columns by setting the
    Text
    and
    Title
    property values.
  9. (optional) In
    Events
    , associate
    Selection changed
    with the
    Refresh
    method.
    The items contained in the object refresh each time you interact with the object.
  10. (optional) Sort items by setting
    Sort order
    and
    Order by
    values.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.