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: FourthWorld, heatherlaine, Klaus, kevinmiller

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

Setting datagrid table column to non-user-editable.

Post by CAsba » Sat Apr 15, 2023 5:56 pm

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: 13865
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Sat Apr 15, 2023 6:02 pm

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: 2743
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

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

Post by stam » Sat Apr 15, 2023 9:13 pm

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: 13865
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Sat Apr 15, 2023 9:45 pm

Sure, but that would be taking a sledgehammer to crack a nut! :D :D :D

stam
Posts: 2743
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

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

Post by stam » Sat Apr 15, 2023 9:51 pm

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: 384
Joined: Fri Sep 30, 2022 12:11 pm

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

Post by CAsba » Sun Apr 16, 2023 3:21 pm

Thank you, gentlemen, that's been a great help.

CAsba
Posts: 384
Joined: Fri Sep 30, 2022 12:11 pm

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

Post by CAsba » Sun Apr 16, 2023 3:50 pm

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: 13865
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Sun Apr 16, 2023 3:59 pm

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: 384
Joined: Fri Sep 30, 2022 12:11 pm

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

Post by CAsba » Tue Apr 18, 2023 9:18 am

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”