Page 1 of 1
Hide DataGrid column on the fly
Posted: Tue Mar 27, 2012 10:40 pm
by lohill
I know I can hide a button under program control with a command like:
set the visible of button "MyButton" to false
I would like to be able to hide a column of a datagrid on the fly. I have tried things like:
'set the visible of column "MyCol" of group "DataGrid 1" to false' - but I get an error message.
It can be done in the Property Inspector so there must be a way under program control.
Any suggestions?
Thanks,
Larry
Re: Hide DataGrid column on the fly
Posted: Tue Mar 27, 2012 10:53 pm
by Zryip TheSlug
lohill wrote:I know I can hide a button under program control with a command like:
set the visible of button "MyButton" to false
I would like to be able to hide a column of a datagrid on the fly. I have tried things like:
'set the visible of column "MyCol" of group "DataGrid 1" to false' - but I get an error message.
It can be done in the Property Inspector so there must be a way under program control.
Any suggestions?
Thanks,
Larry
Hi Larry,
Try:
Code: Select all
set the dgColumnIsVisible["myCol"] of grp "myDatagrid" to false
Where:
- myCol is the name of the column to hide
- myDatagrid is the name of the datagrid
Re: Hide DataGrid column on the fly
Posted: Tue Mar 27, 2012 10:54 pm
by Klaus
Hi Larry,
...
set the dgColumnIsVisible ["Your column name here"] of grp "Your datagrid here" to FALSE
..
Not tested, but should work
Please load this PDF as the one and only DataGrid reference:
http://lessons.runrev.com/s/lessons/m/datagrid/pdf
Best
Klaus
Re: Hide DataGrid column on the fly
Posted: Tue Mar 27, 2012 10:55 pm
by Klaus
Damn, one minute too late for my excellent hint

Re: Hide DataGrid column on the fly
Posted: Tue Mar 27, 2012 11:47 pm
by lohill
Thank you Gentlemen,
The dgColumnsVisible command is not present on the eight or so pages of datagrid commands I keep in from of at all times. It has now been added to my list.
Regards,
Larry
Re: Hide DataGrid column on the fly
Posted: Tue Mar 27, 2012 11:53 pm
by lohill
Whoops - That should be dgColumnIsVisible - singular column 'invisible.
Thanks again