Data Grid Challenges

Michael Doub Mike at Doub.com
Fri Nov 18 17:36:48 EST 2011


I would like to share some of the wisdom of Zryip The Slug (ZTS) as it may be of some help to others not the list.


For the Color problem:
ZTS:  If you have the need to change the color of the background rectangle of a row and not want to use the row color property of the datagrid, you have to rename the rectangle object. Internally the datagrid engine applies the properties set for the row color to the rectangle "background" it finds in the template.

MD:  This is vert subtile.  It looks like best practice would be to always change the name of any controls that you would like customize.


For the Row height issue in GetDataOfLine mode:
MD:  Don't seem to have root cause yet but ZTS offered the following work around:

on OpenCard
   lock screen
   set the dgNumberOfRecords of group "Contacts" to 20
   set the dgProp["row height"] of group "Contacts" to 34
   unlock screen
end OpenCard

By setting the row height property of the dagrid group to 34, all is ok.


And of coarse I made THE CLASIC behaviour mistake in my testing code.
set the rect of graphic "Background" OF ME to x

ZTS:  Never forget to refer to OF ME when you are referencing an object in the behavior script.

Thanks again to Zryip, his help is much appreciated.

Regards,
    Mike





More information about the use-livecode mailing list