Searching for a column name in a DataGrid

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Searching for a column name in a DataGrid

Post by quailcreek » Wed Jul 23, 2014 2:25 am

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
Tom
MacBook Pro OS Mojave 10.14

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Searching for a column name in a DataGrid

Post by dunbarx » Wed Jul 23, 2014 4:17 am

Hi.

try this:

Code: Select all

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

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Searching for a column name in a DataGrid

Post by quailcreek » Wed Jul 23, 2014 4:41 am

Thanks Craig. I didn't think it would be that simple.

Tom
Tom
MacBook Pro OS Mojave 10.14

Klaus
Posts: 14211
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Searching for a column name in a DataGrid

Post by Klaus » Wed Jul 23, 2014 12:28 pm

Hi Tom,
quailcreek wrote:I didn't think it would be that simple.
this is Livecode, get used to it! :D


Best

Klaus

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Searching for a column name in a DataGrid

Post by quailcreek » Wed Jul 23, 2014 1:38 pm

You're right Klaus. But remember, where talking DataGrids here. :D

Tom
Tom
MacBook Pro OS Mojave 10.14

Klaus
Posts: 14211
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Searching for a column name in a DataGrid

Post by Klaus » Wed Jul 23, 2014 3:07 pm

quailcreek wrote:But remember, where talking DataGrids here. :D
Touché! :D

Post Reply