How Do I Customize A Form's Row Template?
When you drop a data grid from the Tools palette onto a card a record template is created for you automatically. This template will display line delimited text but you will most likely want to customize the template. This lesson will show you how to begin customizing the template to meet your needs.
Reveal the Row Template
Example Of A Customized Template
Edit the Behavior Script
The default behavior script contains comments explaining what to do in each handler. The FillInData message is where you move data from a record into a Revolution control. To do this you assign keys of pDataArray (1) to a control (2).
Note that the first parameter passed to FillInData is an array representing the current row being displayed. Also note how this is different than the first parameter passed to FillInData for a column template which is the value of the column.
Important: Make sure that you always refer to controls in the template using 'of me' (3). Since multiple copies of the template will be made you will have multiple controls with the same names. Using 'of me' removes any ambiguity and ensures that data is displayed in the correct control.
An Example of a Customized Behavior
This is an example of a behavior that has been customized. The dgData of the data grid this template is associated with looks like this:
When filling in the data I place the "FirstName" and "LastName" values into a "Name" field (1) and the "Title" value into a "Title" field (2).
This example also shows how to use LayoutControl to layout your row template. Notice how I capture the rectangle of the row template at the beginning (3) and then use it to position all of the other elements (4).