Delphi set Panel visible after post
- by Daan Kleijngeld
this is my code:
if DRelatiebeheer.ContactpersoonID.Post = Action then
KJSMDBGrid1.RefreshData;
KJPanel4.Visible := true;
my question is how can i set the panel on visible when the post is succesfully ended.
I dont know how to fix it, tried many ways but didn't find a solution for the problem.
I think the code doesn't work, because i put it invisible on the OnGetCellParams event.
And I only want to set the last panel visible when the information is posted
procedure TFRelatiebeheer.KJSMDBGrid1GetCellParams(Sender: TObject);
begin
if DRelatiebeheer.ACCID.AsInteger <= 0 then
KJPanel3.Visible := false;
KJPanel4.Visible := false;
else
begin
KJPanel3.Visible := true;
end;
this is my OnGetCellParams event, this is the other
procedure TFRelatiebeheer.SaveCancel(Sender: TObject);
begin
if (DRelatiebeheer.CID.State in [dsEdit, dsInsert]) then
DRelatiebeheer.CID.Post;
DRelatiebeheer.AID.Post;
if DRelatiebeheer.CID.Post = Action then
KJSMDBGrid1.RefreshData;
KJPanel4.Visible := true;
end;