Page 1 of 1
A question about Data Grids
Posted: Tue Apr 02, 2013 6:17 pm
by gardenlevel
Hello
I started working with LiveCode last week and am working on my first program. I am curious if I can do something similar to the two images below with DataGrids. I want to have a grid with a list of info, when I select a row I would like it to drop down and display more data. I would actually like the additional data to be a series of buttons, not just text. Possible, or should I look in to an alternate way to do this?
Before:

- Before
After:

- After
Thank you in advance!
Re: A question about Data Grids
Posted: Tue Apr 02, 2013 8:17 pm
by dave_probertGA6e24
Hi,
Welcome to the forum.
In answer to your question - Yes. DataGrids can be manipulated to work in the way you require. You have to use the 'form' version of them (set on the Inspector panel) and then modify the 'Row Template' to have the basic bits you need. Then you will need to change the 'Row Behaviour' to update your data correctly and to handle the 'dgHilite' change to the 'height' of your row.
Now, the fun part is that even though I know this can be done and I'm pretty sure that there might also be some example/lesson/tutorial/demo of this out there I couldn't find it before I posted this. I personally don't know exactly how to do it, but I know it will involve making the layout for a row change and in there altering the visibility (show/hide) of your extra data (text/buttons/etc) and forcing the row to be taller to accommodate the extra controls. What I haven't figured out is how to force the layout change (LayoutControl) to happen with the pControlRect parameter. I'm sure some other more DataGrid knowledgable person will add that info here for you.
Look under the Runrev Lessons for Data Grid and have a really good read of it to get the hang of the 'form' version of the DG.
I hope that helps a bit,
Dave
Re: A question about Data Grids
Posted: Tue Apr 02, 2013 10:01 pm
by gardenlevel
Very cool. Thanks a bunch! I figured this was possible, but wanted to make sure before I dug too deep.
Re: A question about Data Grids
Posted: Thu Apr 04, 2013 11:26 am
by dave_probertGA6e24
While looking for something else I found the lesson you need:
http://lessons.runrev.com/s/lessons/m/d ... d-contract
Hope that helps.
Dave