Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TPlanner
How to create a TPlanner with Planner.Mode.PlannerType = plTimeLine, with on the left side the time line and in the header the date

The non DB-aware Planner will not configure the header this way automatically. So, you need to programmatically fill the headers with the date information.

This code snippet shows how you can do this on a default Planner:
var
  i: integer;
begin
  planner1.Mode.Date := Now;

  planner1.Header.Captions.Clear;
  planner1.Header.Captions.Add('');

  for i := 0 to planner1.Positions - 1 do
  begin
    planner1.Header.Captions.Add(DateToStr(Now + i));
  end;

  with planner1.CreateItem do
  begin
    ItemStartTime := Now + 1;
    ItemEndTime := Now + 1 + encodetime(2,0,0,0);
  end;
end;