DataGrid column update and button center

Scott Morrow scott at elementarysoftware.com
Fri Aug 6 06:02:39 EDT 2010


Two Data Grid questions:

1)     I'm updating a single column of a Data Grid table.  I can't discover any other way than to loop through each index.  Would this be the accepted method?

--- the code I'm using -------------------------------------------

put the dgData["false"] of grp "DataGrid 1" into tArray
put 1 into tIndexCounter
 -- the column data might look like this as I'm setting the hilite of checkBox buttons
put "true,true,false,true" into tNewColumnData

repeat for each item tNewData in tNewColumnData
     put tNewData into tArray[tIndexCounter]["theColumnName"]
     add 1 to tIndexCounter
end repeat

set the dgData of grp "DataGrid 1" of stack "myStackName" to  tArray
---------------------------------------------------------------------

2)     I have a column of checkbox buttons.  The column header is wider than the button(s) and I would like to be able to center the button(s) in the column.  It seems like I should be able to do this (using the DataGrid inspector) by setting the dgColumnAlignment to "center" but I'm not having any luck.  Any suggestions (hoping I don't need to switch to a "form" layout"  :  )


TIA
Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web       http://elementarysoftware.com/
email     scott at elementarysoftware.com
------------------------------------------------------








More information about the use-livecode mailing list