Setting datagrid table column to non-user-editable.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
CAsba
Posts: 452
Joined: Fri Sep 30, 2022 12:11 pm

Setting datagrid table column to non-user-editable.

Post 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 ?
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post 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
stam
Posts: 3214
Joined: Sun Jun 04, 2006 9:39 pm

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

Post 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…
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus »

Sure, but that would be taking a sledgehammer to crack a nut! :D :D :D
stam
Posts: 3214
Joined: Sun Jun 04, 2006 9:39 pm

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

Post 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 ;)
CAsba
Posts: 452
Joined: Fri Sep 30, 2022 12:11 pm

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

Post by CAsba »

Thank you, gentlemen, that's been a great help.
CAsba
Posts: 452
Joined: Fri Sep 30, 2022 12:11 pm

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

Post 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 ?
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post 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
CAsba
Posts: 452
Joined: Fri Sep 30, 2022 12:11 pm

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

Post by CAsba »

Thanks, Klaus, I picked up the list, many thanks.
Post Reply