I need to change the color of an entire row in a string grid depending on
the value of one of the cells. Ex. if the field called DQ has a value of
true, then I need that entire row to be red.
Please advise.
TIA
Doug Maurer
"Doug Maurer" <dma...@acetrucking.com> escreveu na mensagem
news:3eea0321$1...@newsgroups.borland.com...
What am I missing?
with Sender as TDBAdvStringGrid do
begin
if dmDatamod.resultQryDS.fieldbyname('DQ').asboolean then
begin
canvas.Brush.color:= clRed;
canvas.fillrect(rect);
canvas.Font.color:= clWhite;
canvas.TextRect(rect,arow,acol,Text) ;
end;
end;
.
"Eduardo Andrade Bahiense" <edu...@fdv.com.br> wrote in message
news:3eea...@newsgroups.borland.com...
In the case of your code, if the object you are using doesn't sinchronize
with DataSource, then the behavior you are getting is expected, since the
value of a given field is always the same, regardless the row you are in the
object.
if the object you are using does not update the cursor of your datasource,
then try to do it by yourself before checking the value of a field.
One manner to acomplish this, if the rowcount of your grid is the same of
the recordcount ofyour dataset is
to set the Recno Property the same of Row:
DataSet.Recno := aRow;
Check the condition and set the color;
Hope that helps. I'm leaving for weekend
Eduardo
"Doug Maurer" <dma...@acetrucking.com> escreveu na mensagem
news:3eea09fd$1...@newsgroups.borland.com...