Page 2 of 4

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 2:43 pm
by MaxV
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.

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 3:19 pm
by bbhank
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 6255 times
This is what comes back up, even after restart.

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 3:47 pm
by MaxV
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

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 3:49 pm
by Klaus
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

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:10 pm
by bbhank
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.

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:16 pm
by Klaus
Well, the card you have been adding objects to.

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:21 pm
by bbhank
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.

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:29 pm
by Klaus
You did read the little text at the bottom of that card, not?

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:30 pm
by bbhank
Here's the project browser window.
Application Browser.png

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:34 pm
by Klaus
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!

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:36 pm
by bbhank
Yes. Over and over. How can you not?
There appear to be two fields here. Label and Background.

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:48 pm
by Klaus
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").

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:49 pm
by bbhank
Yessirr! Been there. Done that. Many times. :(

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:52 pm
by Klaus
OK, now add some data to your new datagrid.

Re: How to apply Row and Column Templates to Datgagrid

Posted: Thu Apr 14, 2016 4:52 pm
by bbhank
Just re-ran those steps. No items in grid.
Let me add some data.