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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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
RickJCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.