DBPlanner and TCustomItemEditor

Hello dear TMS team!

Just an other question on DBPlanner/TCustomItemEditor...

I've implemented an descendent from TCustomItemEditor and used
your PlanSimpleEdit as "template".

As speciality I have to use it only in runtime and do it like this:

   itemEditor := TMyItemEditor.Create( self );
   itemEditor.CreateEditor( self );
   selectedPlannerItem.Editor := itemEditor;

This works but only partially:

by opening the editor from plannerItems context menu,
I get all expected data in the Editor.
On closing the Editor with mrOk the changes are
displayed in the planner but the DB data remain unchanged.

If use TPeriodItemEditor the same way, it works!?

Second question:
how do I have to remove the editor at runtime?

Is ItemEditor.Free the right way or do I have to do something else?

Best regards,

I retested this here with creating a TPeriodItemEditor at runtime with the code:

procedure TForm1.Button1Click(Sender: TObject);
  plsimp := TPeriodItemEditor.Create(Self);
  dbplanner1.Items[0].Editor := plsimp;

and this worked fine. The data was updated in the dataset. Without knowing what exactly you did in the custom editor, it is hard to tell what is going wrong.
You can destroy the editor but you need to take in account that you set PlannerItem.Editor := nil;

Hello Bruno,
thank you for your help!

After hours of staring on my code, I've got my error.
One lost line of code in TMyItemEditForm.AssignToPlannerItem:


Sorry, I've been blind...