How to see the difference between a group and a DataGrid via script

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

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
mrcoollion
Posts: 407
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

How to see the difference between a group and a DataGrid via script

Post by mrcoollion » Fri Jan 11, 2019 8:52 pm

Hi fellow LiveCoders,

Can anybody show me how I can see the difference between a group and a DataGrid via script.
I tried the below options but no luck ...

Code: Select all

Get the kind of control ID tControlIDNumber

Code: Select all

Put the style of control ID tControlIDNumber into tControlStyle
Regards,

Paul

Klaus
Posts: 11275
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to see the difference between a group and a DataGrid via script

Post by Klaus » Fri Jan 11, 2019 9:01 pm

Hi Paul

this should do the job:

Code: Select all

...
if the dgprops["control type"] of grp "your datagrid group here" = "Data Grid" then
     answer "I am a datagrid, yay!"
else
    answer "I am not a datagrid, ohhhh!"
end if
...
Or maybe:

Code: Select all

...
if lineoffset("dgprops",the custompropertysets of grp "your group in question here") <> 0 then
     answer "I am a datagrid, yay!"
else
    answer "I am not a datagrid, ohhhh!"
end if
...
Best

Klaus

mrcoollion
Posts: 407
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: How to see the difference between a group and a DataGrid via script

Post by mrcoollion » Fri Jan 11, 2019 9:29 pm

Thanks Klaus for helping me out.

And of course it works......

Regards,

Paul

Post Reply

Return to “Talking LiveCode”