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 »

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: 10502
Joined: Wed May 06, 2009 2:28 pm

Re: Searching for a column name in a DataGrid

Post by dunbarx »

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 »

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

Tom
Tom
MacBook Pro OS Mojave 10.14
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Searching for a column name in a DataGrid

Post 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
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Searching for a column name in a DataGrid

Post by quailcreek »

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

Tom
Tom
MacBook Pro OS Mojave 10.14
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Searching for a column name in a DataGrid

Post by Klaus »

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