Re: Change ROW colors in a grid.
- From: "TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 14 Dec 2006 15:09:06 -0500
Bernhard,
Thanks for all the good input. Yes I can do most all of what you and
others are saying if I create another table or cursor. I just thought
there might be a way of not using another table or cursor but scan the
filtered table in the grid to flip flop the colors. The properties let
you address the columns but not the rows in the grid. Will work on it.
Tony
"Bernhard Sander" <fuchs@xxxxxxx> wrote in message
news:%23ANC$05HHHA.4992@xxxxxxxxxxxxxxxxxxxxxxx
Hi Tony
"Eddy Maue" <eddymaue a@t hotmail.com> wrote in messageInstead of adding a special column to the table(s) you want to show in
news:mn.6d3f7d6c38904b12.66325@xxxxxxxxxxxxxxx
added lcolor and refresh that
check my example
the grid,
use a separate cursor or table.
This separate table (let's call it ColorTable) has the additional
field of Eddy.
ColorTable should have at least the same reccount as your table. It
does not
need any index. Set a relation from your table to ColorTable based on
RECNO():
SET RELATION TO recno() INTO ColorTable
If you change filter or order in your table, use Eddy's RefreshColor
method:
with your table as active table SCAN the whole table and set
ColorTable.lColor
accordingly.
Have your grid
..SetAll("DynamicBackColor",[IIF(ColorTable.lColor,RGB(255,255,255),RGB(192,220,192))])
ColorTable could be reused for any other "your table".
This should work fast enough, if "your table" has only few (some
thousand) records.
Problem with this (and Eddy's) approach: if you edit the table in the
grid, so
that the edited record gets out of scope of the filter or changes its
position
in the sort order, the extra field must be refreshed for the whole
table. This
can be done in the cell's object valid event.
Same kind of problem comes up in multi user environment. But there I
don't see a
chance to reliably detect such changes from other users and trigger
the
RefreshColor
Regards
Bernhard Sander
.
- Follow-Ups:
- Re: Change ROW colors in a grid.
- From: Bernhard Sander
- Re: Change ROW colors in a grid.
- References:
- Change ROW colors in a grid.
- From: TonySper
- Re: Change ROW colors in a grid.
- From: Eddy Maue
- Re: Change ROW colors in a grid.
- From: TonySper
- Re: Change ROW colors in a grid.
- From: Bernhard Sander
- Change ROW colors in a grid.
- Prev by Date: Find unreferenced views
- Next by Date: Re: vfp9, sp2ctp -- xmltocursor() issue.
- Previous by thread: Re: Change ROW colors in a grid.
- Next by thread: Re: Change ROW colors in a grid.
- Index(es):
Relevant Pages
|