Search code examples
delphitms

TMS - properly delete dbPlanner1 Item


I tried :

procedure TForm4.Delete1Click(Sender: TObject);
    begin
dbPlanner1.FreeItem(dbPlanner1.Items.Selected);
end;

But I end up with a sql wait cursor.It deletes the item but I need to click somewhere else to get rid of it. Hitting DEL on keyboard deletes without that cursor. What am I missing?


Solution

  • If you are doing this with a popupmenu menuitem then close the menu :

    procedure TForm4.Delete1Click(Sender: TObject);
        begin
    dbPlanner1.FreeItem(dbPlanner1.Items.Selected);
    ItemPopup.CloseMenu;
    end;