Page 1 of 1

Creating Datagrid columns from a list

Posted: Fri Aug 25, 2017 9:29 pm
by quailcreek
Hi,
I was looking for something like dgCreateColumn but couldn't find anything. I need to create some datagrid columns from a list. I know how to run the repeat statement I'm just looking for the create a column command. Has anybody done this? Thanks in advance.

Re: Creating Datagrid columns from a list

Posted: Fri Aug 25, 2017 10:06 pm
by Klaus
Hi Tom,

you need to set "the dgProp["columns"]" of your datagrid:

Code: Select all

set the dgProp["columns"] of group "Data Grid" to cr_delimited_list_of_column_names
will overwrite existing columns however.

To ADD new columns do something like:

Code: Select all

put the dgProp["columns"] of group "Data Grid" to into columns_old
put columns_old & CR & cr_delimited_list_of_column_names into columns_new
set the dgProp["columns"] of group "Data Grid" to columns_new
Best

Klaus

Re: Creating Datagrid columns from a list

Posted: Fri Aug 25, 2017 10:16 pm
by quailcreek
Perfect Klaus, thanks.