Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Use Data from Data Grid Set As Data Source

  • Last UpdatedJun 25, 2024
  • 1 minute read

You can set the Behavior property of a Data Grid to Data Source to use the data without showing the Data Grid control on the form.

Here we will use data from a Data Grid set as Data Source to set the Button Text for several buttons.

  1. Create a lookup (Database, Repository List, or Web API).

  2. Create a Grid Configuration using the lookup.

  3. Create a form, and add a Data Grid control.

  4. Modify properties of the Data Grid control as follows:

    1. In the Basic tab, set the Configuration Name property to the grid configuration created in Step 2.

    2. In the Advanced tab, set the Behavior property to Data Source.

  5. Add a Text control and several Button controls to the form.

  6. Modify the properties of the Text control as follows:

    1. In the Scripts tab, set the script for the Value property as follows to set the Button Text with the Job_wo_id.

    var numRec;

    var ctrlId;

    var dataSrc = control.findById("G1").source;

    // Loop through the records returned.

    if(dataSrc.length > 0)

    {

    for (i = 0; i < dataSrc.length; i++) {

    numRec = i + 1;

    ctrlId = "B" + numRec;

    control.findById(ctrlId).buttonText = dataSrc[i].Job_wo_id;

    }

    }

    // Return number of records.

    return dataSrc.length;

Related Links
TitleResults for “How to create a CRG?”Also Available in