How Do I Resize Columns?

Using the Property Inspector

Using the Property Inspector

Select the data grid and open the property inspector. Navigate to the Columns pane (1), select the column you want to modify (2), and set the width of the column using the Width text entry field (3).

Using Script

Using Script

You can set the size of a column by setting the dgColumnWidth property for the column to an integer.

set the dgColumnWidth["Name"] of group "DataGrid" to 150

2 Comments

Pais Razvan

How can I resize all the columns of datagrid from code?
With this instruction we can resize one by one
set the dgColumnWidth["Name"] of group "DataGrid" to 150
Thanks!

Elanor Buchanan

Hi Pais Razvan

One way you can do this is to set the "column widths" property of the Data Grid, This allows you to set all column widths at once, you set the property to a comma delimited list of integers where the items in the list are the widths of the columns e.g.

set the dgProps["column widths"] of group "DataGrid 1" to "50,100,150"

There is more about setting DataGrid properties in script in this lesson

http://lessons.livecode.com/m/datagrid/l/7343-data-grid-properties

I hope that helps.

Elanor

Add your comment

E-Mail me when someone replies to this comment