Page 1 of 1

Searching for a column name in a DataGrid

Posted: Wed Jul 23, 2014 2:25 am
by quailcreek
Hi,
How do I determine if a specific column exist in a DG. In other word search for a column by header name.

Here's kinda what I want to accomplish:
if there is a column theColumn then
do some stuff
else
do some different stuff
end if
Thanks,
Tom

Re: Searching for a column name in a DataGrid

Posted: Wed Jul 23, 2014 4:17 am
by dunbarx
Hi.

try this:

Code: Select all

answer the dgProp[columns} of grp "yourDG"
Craig Newman

Re: Searching for a column name in a DataGrid

Posted: Wed Jul 23, 2014 4:41 am
by quailcreek
Thanks Craig. I didn't think it would be that simple.

Tom

Re: Searching for a column name in a DataGrid

Posted: Wed Jul 23, 2014 12:28 pm
by Klaus
Hi Tom,
quailcreek wrote:I didn't think it would be that simple.
this is Livecode, get used to it! :D


Best

Klaus

Re: Searching for a column name in a DataGrid

Posted: Wed Jul 23, 2014 1:38 pm
by quailcreek
You're right Klaus. But remember, where talking DataGrids here. :D

Tom

Re: Searching for a column name in a DataGrid

Posted: Wed Jul 23, 2014 3:07 pm
by Klaus
quailcreek wrote:But remember, where talking DataGrids here. :D
Touché! :D