WannaKnow
WannaKnow

Reputation: 88

Changing cell data

For a project I need to work in RadPHP XE2

In this project I created a DBGRid.

This is all working fine.

Now I need to change the cell color for each cell.

The color for the cell is depending on the value inside that cell.

Like this:

if value > 0 return green else return red

Upvotes: 0

Views: 234

Answers (2)

Ertunç
Ertunç

Reputation: 829

I think you should add the color changing code in OnBeforeShow event of the dbgrid component.

Upvotes: 0

Timothy Martens
Timothy Martens

Reputation: 688

Well here is the PHP code for what you need. =) Don't really understand your question all that well though.

if( $value > 0 ){

    return "red";

}else{
    return "green";
}

Upvotes: 0

Related Questions