Is it possible to set the visible columns of a datagrid 'at once' instead of looping through each column and setting dgColumnIsVisible... thats slow (btw that property doesnt even check if the setting set is the same as the current setting, so causes unnecessary delays... thats why I check it myself before setting it)
Would be nice if theres something like set the visibleColumns of group "dg1" to "col1,col3,col4"
datagrid visible columns
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: datagrid visible columns
Hi - changing the visibility property of a range of datagrid columns in a repeat loop should be very fast - if it's taking a long time maybe check you have 'lock screen' enabled...
Dave
Dave
"...this is not the code you are looking for..."
Re: datagrid visible columns
Hi rinzwind,
you can set this for TABLE datagrids:
...
column visibility
- Allows you to set the visible property for all columns at once. Line delimited list of boolean values.
## Looks like an error, we need to provide a COMMA delimited list, see below!
...
Example:
...
set the dgProps["column visibility"] of grp 1 to "false,true,true"
## Will hide the first column in your datagrid
...
Good advice:
Download the Datagrid docs in PDF format here: http://lessons.livecode.com/m/datagrid and read it at least about 20 times!
Best
Klaus
you can set this for TABLE datagrids:
...
column visibility
- Allows you to set the visible property for all columns at once. Line delimited list of boolean values.
## Looks like an error, we need to provide a COMMA delimited list, see below!
...
Example:
...
set the dgProps["column visibility"] of grp 1 to "false,true,true"
## Will hide the first column in your datagrid
...
Good advice:
Download the Datagrid docs in PDF format here: http://lessons.livecode.com/m/datagrid and read it at least about 20 times!

Best
Klaus
Re: datagrid visible columns
woops... column visibility it is. Thanks! Makes all the difference!
edit: hmm it does not improve things much, a little slower even (guess to do with that it not checks if a column really needs a change of visibility (current state could already be what the new setting is).. little bug and not looking too good at the result made me think it was fast. Well.. it's not a show stopper but just a bit slow and a bit weird, because something like reordering columns is fast.
Hmm what helps is put the dgData into a temp var, set it to empty, do the column thing, set it back.
edit: hmm it does not improve things much, a little slower even (guess to do with that it not checks if a column really needs a change of visibility (current state could already be what the new setting is).. little bug and not looking too good at the result made me think it was fast. Well.. it's not a show stopper but just a bit slow and a bit weird, because something like reordering columns is fast.
Hmm what helps is put the dgData into a temp var, set it to empty, do the column thing, set it back.