How Do I Customize A Table's Columns?

A column template is nothing more than a LiveCode control that is named after a column in your table. This control is located in the row template group for your data grid. This lesson will discuss how to create templates for columns in a data grid table.

Use the Property Inspector To Create a Column Template

Use Property Inspector To Create a Column Template

Drag out a new Datagrid from the Tools Palette, and open the Property Inspector. On the "Data Grid" tab, check that the Style is "table". Now move to the Columns tab. Click the "+" (1) next to the Columns: heading. Create three columns and name them Name (2), Email and Login.  

Select the column to customize

In the Property Inspector, select the column you would like to customize (1). Click the "+" button next to the Column Behavior at the bottom of the pane to create a  new column behavior (2).

Edit the Row Template Group

Edit the Row Template Group

In order to customize the look we need to edit the contents of the template group.

Ensure you have "Select Grouped" turned off (1), select the "Row Template" group (2) and click "Edit Group" (3) in the LiveCode toolbar.

Edit Column Group

Edit Column Group

Now select the column group (1) and click "Edit Group" again (2). At this point you can customize what controls appear in the column template.

For example you could change the text style and color of the Login field.

Testing the DataGrid

Now select your DataGrid again, open the Property Inspector and click "Refresh Data Grid" in the Data Grid pane. You could see your customized display for the Login column.

4 Comments

Michael

In a Table, can I customize a cell to re-format itself to increase its height and display text that is wrapped in the cell so that none of the text is cut off?

Trevor DeVore

@Michael: Not at this time. Tables have a fixed line height so you can only adjust the height for all rows, not individual rows.

Wes

How do can I remove columns from the table?

Elanor Buchanan

@Wes: In the Property Inspector you select the column and then click on the Trash icon, you will be asked to confirm the deletion.

I hope that helps.

Elanor

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.