Paiting a row based on certain column data using TwwDBGrird from Infopower (Woll2woll)

I'm using Delphi7, Infopower 4000, component TwwDBGrid.

I want to paint certain rows, the full row, based on the data on certain columns.
I have some code, using OnCalcCellColors event, which allows me to paint the current cell. But I don't want just that, I want to paint the whole current row.
How can I do that?
LVL 1
fischermxAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
RickJConnect With a Mentor Commented:
To highlight the selected row and still allow editing do this;
In the options set dgAlwaysshowSelection to true, set dgRowSelect to false.
In the paintoptions set ActiverecordColor to clHighlight.

Then in the oncalccellcolors do this;

if Highlight then
  ABrush.Color := whatevermycoloris;

You can really use quite alot of combinations in this event to get what you need.
0
 
SteveBayCommented:
I am not familiar with TwwDBGrid, however I believe that you can still decide how to paint every cell in a row by inspecting the value in the table rather than the value in the cell
for example:
 If wwDBGrid1.dataSource.Dataset.FieldByName(ColumnName).AsInteger = MyIntegerValue then
      PaintItMyWay
Else
      PaintItTheOtherWay;
0
 
SteveBayCommented:
If you show your event handler code I could supply a more specific example.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
RickJCommented:
This works fine for me, may be dependant on other properties set, but this is with dropping a grid on form without changing any properties.
In the oncalccellcolors event;

if wwDBGrid1.dataSource.Dataset.FieldByName(ColumnName).AsBoolean then
    ABrush.color := clRed ;

Highlights the full row. Others that dont match the condition are as default.
Does this not work for you?
0
 
RickJCommented:
Oh, sorry just read the question again, are you trying to highlight the selected row?
If so, let me know as this can be done a couple of ways...
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
All Courses

From novice to tech pro — start learning today.