i want to check all field mandatory are fill in twebdbgrid;
how i can do it?
procedure TForm1.T1BeforePost(DataSet: TDataSet);
var
res: TModalResult;
Recno:Integer;
begin
if (T1id.IsNull or(T1id.AsString=''))or(T1name.IsNull)or(T1name.AsString='') then
begin
Recno:=T1.RecNo;
res := await(TModalResult, MessageDlgAsync('The Record is incomplate, do you want complete?', mtConfirmation, [mbYes, mbNo])
);
if res = mrYes then
Try
T1.BeforePost :=nil;
if Recno>0 then
T1.RecNo:=Recno;
T1.Cancel;
//T1.Edit;
// Abort;
finally
T1.BeforePost :=T1BeforePost;
end else
Try
T1.BeforePost :=nil;
if Recno>0 then
T1.RecNo:=Recno;
t1.delete;
// Abort;
finally
T1.BeforePost :=T1BeforePost;
end;
end;
end;