How Do I Create a Form with Variable Line Heights?
This lesson will show you how to create a data grid form with variable height lines by modifying the default data grid Row Template and Row Behavior.
To begin, turn off fixed control height for your data grid form in the property inspector.
Open the card that has the row template group by clicking the Row Template button.
The default row template for a data grid has a single field that displays data.
- Ensure Select Grouped is turned on using the button in the Menubar.
- Select the field.
- Using the Property Inspector turn off dontWrap.
You can now close the stack.
Return to the Property Inspector for your data grid. Edit the row behavior by clicking on the Edit Script button.
You only need to make a few modifications to the default LayoutControl handler in order to get your field to resize to fit the height.
The default LayoutControl handler resizes the field to fill the available width (1). After that is done you then need to resize the field to fill the formattedHeight (2). Finally, resize adjust the rect of the Background graphic to take into account the new field height (3).