Page 1 of 1

SOLVED: xBrowse Tree bClrStd Not Working

PostPosted: Sat Apr 14, 2012 3:27 am
by fraxzi
This code works in array and rdd but not on tree

on array:
Code: Select all  Expand view

...
oBrw:bClrStd := {|| {CLR_BLACK, IF( oBrw:nArrayAt % 2 == 0, nRGB( 235, 235, 235 ), nRGB(251,253,255) ) }}
...
 


on rdd:
Code: Select all  Expand view

...
oBrw:bClrStd := {|| {CLR_BLACK, IF( (cAlias)->( RecNo() ) % 2 == 0, nRGB( 235, 235, 235 ), nRGB(251,253,255) ) }}
...
 


on tree: PROBLEM
Code: Select all  Expand view

...
oBrw:bClrStd := {|| {CLR_BLACK, IF( oBrw:oTreeItem:ItemNo() % 2 == 0, nRGB( 235, 235, 235 ), nRGB(251,253,255) ) }}
...
 


Maybe I got it wrong.. Any Idea?

Re: xBrowse Tree bClrStd Not Working

PostPosted: Mon Apr 16, 2012 5:16 am
by anserkk
Code: Select all  Expand view
aClrCol:={ { 0, nRGB(192,221,255) }, { 0, nRGB(221,245,255) } }

// Changing Alternative Row-Colors
oBrwGroups:bClrStd := { || aClrCol[ oBrwGroups:KeyNo % 2 + 1 ] }  


Image

Regards
Anser

Re: xBrowse Tree bClrStd Not Working

PostPosted: Mon Apr 16, 2012 6:03 am
by nageswaragunupudi
As Mr Anser suggested, the expression oBrw:KeyNo % 2 works for all browses, whether array, dbf, recordset, etc.
It is desirable to adopt this generic approach.

Re: xBrowse Tree bClrStd Not Working

PostPosted: Mon Apr 16, 2012 9:13 am
by fraxzi
Thanks Mr. RAO, Mr. Anser..

It works like a charm..