Find item created by PlannerWaitList.MoveToPlanner

Hello,

I'm using the method TPlannerWaitList.MoveToPlanner in the OnDragDrop event of a TPlanner in order to drag and drop TPlannerItem from a TPlannerWaitList to a TPlanner component. After calling this method I want to get the TPlannerItem that has been created in order to modifiy properties of its ItemObject.

I have tried the following code which is not guarantee to work when planner items can overlap (which is the case for me) because it is possible that the user drops a TPlannerItem in the left part of the Cell but the new overlapping planner item is created to the right part.:


    MyPlannerWaitList.MoveToPlanner(MyPlanner, MyPlannerWaitList.ItemIndex, X, Y);
    PlannerItem := MyPlanner.XYToItem(X, Y);  //Pointer can be nil or a pointer to another planner item in the same cell



Is there an easy way to get the TPlannerItem created after calling MoveToPlanner?




Try to access it as last item in the Items collection. When it gets added, its appended to this list.

It works perfectly.
Thanks Bruno.