How Do I Use A Template In Multiple Data Grids?
If your application needs to use the same style of data grid in multiple places in your project then you can easily share the same row template between multiple data grids. This lesson will show you how.
Create First Data Grid
The first step is to create your first data grid and customize the template (1). The data grid property that determines the Row Template that is used to draw the data grid is dgProps["row template"]. In the message box you can see that I queried this property in order to get a reference to the data grids row template (2).
Create Other Data Grids
Now you can add other data grids to your project. After adding the data grid you can set the dgProps["row template"] property to the long id of the first data grid's row template. Alternatively you could also do the following:
set the dgProps["row template"] of group "DataGrid 1" of stack "Untitled 1" to the dgProps["row template"] of group "DataGrid 1" of stack "my program"
Note: The Revolution IDE creates a card in the "Data Grid Template XXX" stack with a row template every time you drag a data grid on to a card. You may want to delete this card if you aren't going to be using the template.
Now both data grids will display data using the same template.