Coloring cells depending on day

Hi,


DBPlanner 3.1.0.1
dbDaySource and dbMultiMonthSource (especially).

I'm trying to figure out how to change the background color of the cell (and font), depending on the day, but I seem to not find the event for this. Is it this possible?

I want to color the cells representing a sat and sun in another color. (they should not be inactive, just another color, like can be done in the dbPlannerMonthView.

Am I overlooking something?

Thank,
Tom.



You can use the OnPlannerBkgProp event for this. This is triggered for each cell and allows to set the color for a cell via the ABrush parameter.

Alternatively, you can set the background color for a cell via:
  planner.BackgroundColor[column,row]: TColor;

Hi Bruno,


Thanks for your reply. I tried this event, but it didn't work, so I thought it the event was for something else. Anyhow, I'll try again.

Regards,
Tom.
Ok, so it is OnPlannerBkgDraw. 

Thanks, Tom.
simple example:

procedure TfraCalendar.dbCalendarPlannerBkgDraw(Sender: TObject;
  Canvas: TCanvas; Rect: TRect; Index, Position: Integer);
var
  CellColor: TColor;
  CellBrush: TBrushStyle;
begin
  CellColor := clRed;
  CellBrush := Canvas.Brush.Style;
  if position= 3 then
        PlanUtil.RectHorzEx(Canvas, Rect, CellColor, dbCalendar.Color,
          (Sender as TPlanner).GridLineColor, Canvas.Pen.Color, Canvas.Pen.Width,
          CellBrush);
end;