Data Grid property names

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Data Grid property names

Post by phaworth »

Data Grids are working great fro me now, thanks to yhose who helped.

I have one more piece of the puzzle left. I have a handler that determines excatly what type of object is currently selected (field, list, combbobox, check box, etc) by looking at the object type in conjunction with things like the style property. I see that data grids are group objects but is there some other property I can check that will tell me it's a data grid?

Thanks,
Pete
Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel »

Hmm, I'd say your best bet is to check for the presence of the 'dgData' custom property set.

Code: Select all

function isDatagrid pLongId
  if word 1 of pLongId is "group" and "dgData" is among the lines of the customPropertySets of pLongId
  then return true
  else return false
end isDatagrid
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore »

One small tweak Jan. Change dgData to dgProps and your handler should be good to go.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus »

Or try this prop, which is meant for exactly this purpose :)

Code: Select all

function isDatagrid pLongId
    return (the dgProps["control type"] of pLongID = "Data Grid")
end isDatagrid
Best

Klaus
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth »

Thanks all, been out of town for a few days but just tried the last dgProps suggestion and it works fine.
Post Reply