1. Marco Armbruster
  2. PowerBuilder
  3. Thursday, 25 April 2024 10:15 AM UTC

Hello,

is there any syntax for setting the expression for the transparency of the backcolor in the detail band?

 

I tried

modify( " datawindow.detail.Transparency.expression =  ' if( mod( getrow(), 2 ) = 0, 100, 50 ) ' " )

also tried

modify( " datawindow.detail.Transparency =  ' if( mod( getrow(), 2 ) = 0, 100, 50 ) ' " )

but nothing works. 

 

I just want to have alternating background colors when displaying multiple rows in a grid datawindow.

 

Any idea?

Accepted Answer
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 25 April 2024 10:57 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Marco,

If you want to specify an expression you have also to specify a default value.

So syntax is:

modify( " datawindow.detail.Transparency =  '100~t if( mod( getrow(), 2 ) = 0, 100, 50 ) ' " )
Comment
There are no comments made yet.
Marco Armbruster Accepted Answer Pending Moderation
  1. Thursday, 25 April 2024 11:16 AM UTC
  2. PowerBuilder
  3. # 1

@René.

You got the solution.

Many Thx!

 

@Andreas

I use that statement in almost every grid datawindow. It´s working fine and quick.

But I had to make the settings in every new datawindow. Even though I use

a parent object for all my datawindows I´ve never had the idea to do this by script

in my parent object. But now ;-)

Comment
  1. Andreas Mykonios
  2. Thursday, 25 April 2024 11:22 AM UTC
Very nice.
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 25 April 2024 11:05 AM UTC
  2. PowerBuilder
  3. # 2

Hi.

Are you trying to implement something like that (?) :

If yes you you have to set pick a color for <Columnname>.Background.Color and set an expression for <Columnname>.Background.Gradient.Transparency.

For the above one the expression I use is if( mod( getrow(), 2 ) = 0, 60, 30 )...

You cannot achieve that in background of detail band using colors and expressions, but you may be able to do that using carefully designed picture...

You will have to set all appropriate values... Never tried to do that. Don't know if it would work and how fast it will run...

Andreas.

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.