Adding a lookup field to the grid

You can only see the employee number in the above grid, but not the name. As the name comes from another table (employee), the only way to retrieve that value is by adding another custom column to the grid and binding that to the employee.

To achieve that, the following steps are required.


Open the fields property



  • Open the fields property 


  • Click on the + to add a custom field

  • Select the datasource and dbconnection that holds the reference to the lookup key.
  • Select the table 'employee'
  • Setup the lookupfield for name and define label.
  • Create a mapping between the two tables on employee number



Now generate and run the application



To move the name field to the second position, just drag/drop the field to the desired position.


\

You can change the lookup field by adding more data fields. In PHsPeed 2.1, you need to use an event to intercept the rendering of the field, in version 2.2 you can easily add new fields and constants to generate output.



The result will be: