Page 1 of 1

Datagrid

Posted: Sun Jul 26, 2015 7:52 pm
by parsec
Hello
is any way to be able to pick the column names under the property inspector setup provide you have connected to a database and have select a table.
as of now I have to open the database and copy and paste or manually enter the column names
also in the edit script have to find the columns go from there
Thank you
J

Re: Datagrid

Posted: Sun Jul 26, 2015 9:33 pm
by dunbarx
Hi.

Have you played with the "dgColumnName" property? Read about it in the dg manual, page 216.

Craig NEwman

Re: Datagrid

Posted: Sun Jul 26, 2015 9:57 pm
by parsec
I have seen that but I still do not see were I can do what I like to do
I am able to connect to a DB
What I was looking to do is to be able to select a table and then select the columns that I want to have on the my dgData as Columns_Names/Header and Labels . I have read the manual on the subject but I cant find a way to do that from the property inspect
thank you
perhaps I miss something

Re: Datagrid

Posted: Mon Jul 27, 2015 12:46 pm
by Klaus
Hi parsec,

"datagrids" are the most complex objects EVER in Livecode

Most of the dg functionality can only be SCRIPTED, so I'm afraid
you need to do some reading and experimenting first.

Go here and check all the lessons and/or download hte PDF documentation,
it's the only docs we have for datagrids:
http://lessons.runrev.com/m/datagrid


Best

Klaus

Re: Datagrid

Posted: Mon Jul 27, 2015 3:03 pm
by Mikey
For my apps, I pre-set the columns, widths, labels, etc. right in my datagrid, without scripting it. I have just found that to be easier than doing it dynamically. If you have to do it dynamically, then you should check out the datagrid manual. It is a very good reference and very complete.

For your question, check out the API and Properties section, which starts at page 209. For scripting the column headers, labels, etc. check out page 213-214.

Datagrids are very easy to use with databases without having to screw around, so if, after checking out the manual, you are having issues, chances are you are trying too hard.