How to switch Row-Colors in xBrowse (without Function)

Post Reply
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

How to switch Row-Colors in xBrowse (without Function)

Post by ukoenig »

Hello

There is a easy way to switch row colors
without any function

Code: Select all


// Define alternating row colors 

// Col 1
// ------
oLbx1:aCols[ 1 ]:bClrStd := ;
{|| IIF( AT(".0",  STR( oLbx1:nArrayAt / 2 ) ) > 0, ;
                        {CLR_BLACK, COLOR1}, {CLR_BLACK, COLOR2} ) }

// Col 2
// ------
oLbx1:aCols[ 2 ]:bClrStd := ;
{|| IIF( AT(".0",  STR( oLbx1:nArrayAt / 2 ) ) > 0, ;
                        {CLR_BLACK, COLOR1}, {CLR_BLACK, COLOR2} ) }

Regards

Uwe[/code]
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Mr ukoenig

It is necessary for us to create a codeblock.

1. It is not necessary to assign bClrStd for each column. It is enough if we assign the codeblock to oBrw:bClrStd. By default, all columns inherit oBrw:bClrStd.

2. Also there is a way which applies to RDD, RecSet, Array or any data source.

The code is :

Code: Select all

oBrw:bClrStd := { || If(  Eval( oBrw:bKeyNo, nil, oBrw ) % 2 == 0, { CLR_BLACK, COLOR1 }, { CLR_BLACK, COLOR2} ) }
This one line of code is enough for all columns and for any datasource, bet it a DBF, Array, RecordSet or whatever.
Regards

G. N. Rao.
Hyderabad, India
Post Reply