Grid.AutoSizeColumns

Grid.AutoSizeColumns ( 

string  ObjectName,

number  ResizeMode = GVS_DEFAULT,

boolean Redraw = true )

Example 1

-- Set auto size for all columns
Grid.AutoSizeColumns("Grid1", GVS_DEFAULT, true);

AutoSize all columns

Example 2

-- Get the total Columns in the grid
ColumnCount = Grid.GetColumnCount("Grid1");

-- loop through each Column and add a numbered message
for i = 0, ColumnCount do
     -- Set the text of the Columns
     Grid.SetCellText("Grid1", 0, i, "Stats "..i, true);
end

-- Set auto size for all columns
Grid.AutoSizeColumns("Grid1", GVS_DEFAULT, true);

Uses a loop to add a numbered message to each column.

See also:  Related Actions