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

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

Postby ukoenig » Wed Mar 26, 2008 1:43 pm

Hello

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

Code: Select all  Expand view  RUN

// 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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby nageswaragunupudi » Wed Mar 26, 2008 2:15 pm

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  Expand view  RUN
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
User avatar
nageswaragunupudi
 
Posts: 10648
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi, Otto and 37 guests