View Issue Details

IDProjectCategoryView StatusLast Update
0005009JEDI VCL00 JVCL Componentspublic2010-06-07 13:43
ReporterTwoLostSoulsAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionunable to reproduce 
Product Version3.38 
Target VersionFixed in Version 
Summary0005009: Cell font recoloring carries over to other cells in JvDBGrid
DescriptionThis code should color certain cells specific colors. It has worked in the past, but now and change to color font is reflected to all records and all fields in the grid, not as required.

procedure TCallList.DBGridOrdersDrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  if qryOrders.FindField('IsDispatched').AsBoolean then
  begin
    DBGridOrders.Canvas.Brush.Color := clSkyBlue; //clInactiveCaptionText;
    //DBGridOrders.Canvas.Font.Color := clBlack;
  end;
  if qryOrders.FindField('CancelCall').AsBoolean then
  begin
    DBGridOrders.Canvas.Brush.Color := clLtGray;
    //DBGridOrders.Font.Color := clWhite;
  end;
  if qryOrders.FindField('WasDead').AsBoolean then
  begin
    DBGridOrders.Canvas.Brush.Color := clRed;
    DBGridOrders.Font.Color := clWhite;
  end;
  if (DataCol > 0) and (DataCol < 6) then
  begin
    DBGridOrders.DefaultDrawColumnCell(Rect, DataCol, Column, State);
  end;
end;

In this example, all fonts are colored white, not their default black. If font colors aren't changed, everything is okay.
TagsNo tags attached.

Activities

obones

2009-12-04 14:45

administrator   ~0016933

Please send us the zipped sources of a sample application showing this

obones

2010-03-09 12:19

administrator   ~0017287

Any news?

obones

2010-06-07 13:43

administrator   ~0017441

No sample, unable to reproduce

Issue History

Date Modified Username Field Change
2009-11-06 00:29 TwoLostSouls New Issue
2009-12-04 14:45 obones Note Added: 0016933
2009-12-04 14:45 obones Status new => feedback
2010-03-09 12:19 obones Note Added: 0017287
2010-06-07 13:43 obones Note Added: 0017441
2010-06-07 13:43 obones Status feedback => resolved
2010-06-07 13:43 obones Resolution open => unable to reproduce
2010-06-07 13:43 obones Assigned To => obones