Page 1 of 1

Setting datagrid table column to non-user-editable.

Posted: Sat Apr 15, 2023 5:56 pm
by CAsba
Hi,
Can anyone tell me aa EASY way to select a column in a dg table and set it to non-user-editable ?

Re: Setting datagrid table column to non-user-editable.

Posted: Sat Apr 15, 2023 6:02 pm
by Klaus
Hi CAsba,

you need to use the message box for that:

Code: Select all

set the dgColumnIsEditable["your column name here"] of group "your datagrid group here" to FALSE
Best

Klaus

Re: Setting datagrid table column to non-user-editable.

Posted: Sat Apr 15, 2023 9:13 pm
by stam
Or, if you could just create a behaviour for the column in question and comment out the contents of the mouseDoubleUp handler for that column…

Re: Setting datagrid table column to non-user-editable.

Posted: Sat Apr 15, 2023 9:45 pm
by Klaus
Sure, but that would be taking a sledgehammer to crack a nut! :D :D :D

Re: Setting datagrid table column to non-user-editable.

Posted: Sat Apr 15, 2023 9:51 pm
by stam
Perhaps but as I always create behaviours for columns (either to do an action, add controls such as checkboxes or even just set margins to correct vertical alignment as I find the default row height very stingy), it is but a minor issue to just adjust the mouseDoupleUp handler. Plus don’t have to remember yet another command ;)

Re: Setting datagrid table column to non-user-editable.

Posted: Sun Apr 16, 2023 3:21 pm
by CAsba
Thank you, gentlemen, that's been a great help.

Re: Setting datagrid table column to non-user-editable.

Posted: Sun Apr 16, 2023 3:50 pm
by CAsba
Hi Klaus,
That was a real simple and effective line of code. Is there a source of such snippets like that for all the other property variants to manage datagrids ?

Re: Setting datagrid table column to non-user-editable.

Posted: Sun Apr 16, 2023 3:59 pm
by Klaus
Hi CAsba,

I worked through all of these LC lessons:
https://lessons.livecode.com/m/datagrid
https://lessons.livecode.com/m/datagrid_tips
A DataGrid is currently the most complex beast in LC, but worth the effort to master it! :-)

There has been a PDF with all of these lesson of the LC webpage, but that is not available anymore.
I put my copy into my Dropbox, get it here if you like:
https://www.dropbox.com/s/l1cqiohy2it3e ... d.pdf?dl=1

Best

Klaus

Re: Setting datagrid table column to non-user-editable.

Posted: Tue Apr 18, 2023 9:18 am
by CAsba
Thanks, Klaus, I picked up the list, many thanks.