How to apply Row and Column Templates to Datgagrid

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

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by MaxV » Thu Apr 14, 2016 2:43 pm

bbhank wrote: How are items placed into/onto the datagrid so that they show up and are usable in the project, is the question. I've been through lots of tutorials and so forth without finding usable answers.
Every datagrid refers to a substack called Datagrid Templates 14483xxxxxx, here the are 2 cards. The second has the custom items if you pressed the + button for that columns.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 3:19 pm

Nope.
The controls do not appear like that for me. This is actually the question.
I start with a blank DataGrid.
Then the Row Template is brought up.
Then drag in the fields and buttons (controls). Here 3 fields have been drug onto the grid.
DataGrid Screen 2.png
Missing step - How to get the fields to appear in the DataGrid. The instructions all seem to jump over this. And, yes, I am missing something! :)
Blank DataGrid.png
Blank DataGrid.png (8.84 KiB) Viewed 6097 times
This is what comes back up, even after restart.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by MaxV » Thu Apr 14, 2016 3:47 pm

No, no, no.
This is the correct sequence:
  • create the datagrid,
  • then use the property inspector (columns tab) to create the columns
  • then use the property inspector (comuns tab) and press the + button in the bottom of the property inspector to activate the modifications for the column that you want to modify. So select the column to modify and press the + button.
  • Use the application browser to modify the groups of the custom columns. For example if you activate the + for the column 2, a col2 groups appears inside Datagrid Templates 14483xxxxxx stack
  • restart your stack and use

    Code: Select all

     send "addLine 1 " to group "myDatagrid"
    to add custom lines
Last edited by MaxV on Thu Apr 14, 2016 3:49 pm, edited 1 time in total.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by Klaus » Thu Apr 14, 2016 3:49 pm

Hi Hank,

please load the datagrid docs as PDF here: http://lessons.livecode.com/m/datagrid
and read them a couple of times, datagrids are highly complex beasts!
I still have to read up this PDF every time I use a datagrid of type FORM, because of its complexity!

Basically you need to add objects to the group "Row template" on that namely card to appear in the datagrid,
and not to the card itself as you did.


Best

Klaus

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 4:10 pm

I've been all through that reference. It skips this step.
What is that namely card you're talking about? That's a major key right now.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by Klaus » Thu Apr 14, 2016 4:16 pm

Well, the card you have been adding objects to.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 4:21 pm

I put 3 fields in this starting from new document and dragging a datagrid onto it.
Row Template.png
What I got is the previously posted blank.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by Klaus » Thu Apr 14, 2016 4:29 pm

You did read the little text at the bottom of that card, not?

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 4:30 pm

Here's the project browser window.
Application Browser.png

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by Klaus » Thu Apr 14, 2016 4:34 pm

Please take a look at your screenshot posted here: http://forums.livecode.com/viewtopic.ph ... 17#p141113
and read the text at the bottom of THAT card!

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 4:36 pm

Yes. Over and over. How can you not?
There appear to be two fields here. Label and Background.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by Klaus » Thu Apr 14, 2016 4:48 pm

Hm, are we talking about the same thing?
I mean this unambiguous text on card 2 of the "Data Grid Templates XXXXXXXXXX" stack:
###########################################################################
You can edit the "Row Template" group on this card to customize the look and feel
of your data grid form or table. To begin, select the "Row Template" group and choose
Object > Edit Group menu item.
###########################################################################
Do it and then add objects to that group ("Row template").

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 4:49 pm

Yessirr! Been there. Done that. Many times. :(

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by Klaus » Thu Apr 14, 2016 4:52 pm

OK, now add some data to your new datagrid.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 4:52 pm

Just re-ran those steps. No items in grid.
Let me add some data.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”