Alternating Column Colors?
bobs at twft.com
Mon Jan 31 11:51:59 EST 2011
Wait, you can do this even if there is no data if the data grid?
On Jan 29, 2011, at 11:25 AM, Phil Davis wrote:
> Each cell in a data grid is a field, so it seems like it should be doable.
> I created a DG and put some data in it. Then I did this from msg:
> put the number of flds in selobj -- DG was selected
> --> 57
> put the name of fld 44 of selobj
> --> field "Status 0008"
> My DG has a column named "Status".
> After further poking around, I see:
> - each DG cell is a field
> - the number of fields is related to the display rect of the DG, not to the number of lines of data in it
> - fields are recreated when the DG's data is changed
> - every field in the DG has a style of 'transparent'
> - you can set a field's style to opaque and then any backColor you apply to it will show up
> - the style changes you make seem to stick until the DG data is changed
> Maybe some of the above will help you on your way.
> On 1/28/11 3:54 PM, Bob Sneidar wrote:
>> Oh cool! Then you could make a chess or checkers game! I get it!
>> I read the API and none of the properties suggests you can do this. I think you will have to find the part of the parent script that draws the cells and change the background color on each one individually for odd or even rows.
>> The problem will then become, what happens if there is no data? Rows get colored even if there is no data, but no actual cells (cloned fields) get created until there is data.
>> I tried to edit the row template and put a colored square over the gray bar, but mine is a table not a form. You might be able to do it in a form, I'm not sure. At any rate it didn't work for me.
>> On Jan 28, 2011, at 1:55 PM, Scott Rossi wrote:
>>> Hi List:
>>> The data grid nicely incorporates alternating line colors. But does anyone
>>> know if it's possible to make alternating column colors or cell colors?
>>> I'm building a control that has a horizontal scrolling data grid with only
>>> one row. I'd like to be able to set alternating colors for cells or columns
>>> in the row. Possible?
>>> Thanks& Regards,
>>> Scott Rossi
>>> Creative Director
>>> Tactile Media, UX Design
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> Phil Davis
> PDS Labs
> Professional Software Development
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode