Tom_Conlon
(Tom Conlon)
1
Hi,
"The TPlannerMonthView and TDBPlannerMonthView components are very similar and very compatible with the TPlanner and TDBPlanner components"
I thought therefore that this would be possible
planMonth.items.Assign(planner.Items);
planMonth.Update;
The code doesn't complain but nothing is displayed in the TPlannerMonthView .
Tom
Tom_Conlon
(Tom Conlon)
2
Update: this does work but a little disappointing the assignment didn't.
planMonth.Items.BeginUpdate;
try
// planMonth.Items.Assign(planner.Items);
for i := 0 to planner.Items.count-1 do
begin
tempitem := planner.Items;
planitem := planMonth.Items.Add;
planitem.ItemStartTime := tempitem.ItemStartTime;
planitem.ItemEndTime := tempitem.ItemEndTime;
planitem.CaptionText := tempitem.CaptionText;
planitem.Text.Text := tempitem.Text.Text;
end;
finally
planMonth.items.EndUpdate;
planMonth.Update;
end;
Tom_Conlon
(Tom Conlon)
3
Correction:
tempitem := planner.Items;
Tom_Conlon
(Tom Conlon)
4
Sorry, with BBCodes enabled, the editor kept stripping the index on the end!
tempitem := planner.Items[i];
Sorry, direct assignment is indeed unfortunately not working because indexing/position of items in the Planner is different from the PlannerMonthView.