Convert from fmxlivegrid to fncgrid

procedure TBOMForm.BOMITEMSGridCellEditDone(Sender: TObject; ACol,
ARow: Integer; CellEditor: TControl);
var
fg : Boolean;
begin
fg := False;
FDTbl8B.Edit;
BOMITEMSGrid.BeginUpdate;
if (ACol = 0) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('SORTID').ASINTEGER := STRTOINT(BOMITEMSGrid.Cells[Acol, Arow]);
END
else
if (ACol = 1) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('DESCRIPTION').ASSTRING := BOMITEMSGrid.Cells[Acol, Arow];
END
else
if (ACol = 2) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('TYPE').ASSTRING := BOMITEMSGrid.Cells[Acol, Arow];
END
else
if (ACol = 3) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('NUM').ASSTRING := BOMITEMSGrid.Cells[Acol, Arow];
FDTbl8B.FieldByName('DESCRIPTION').ASSTRING := 'Add '+BOMITEMSGrid.Cells[Acol, Arow];
fdquery000.Close;
fdquery000.ParamByName('NM').AsString := BOMITEMSGrid.Cells[Acol, Arow];
FDQUERY000.Open;
if FDQUERY000.RecordCount > 0 then
BEGIN
FDTbl8B.FieldByName('PARTID').ASINTEGER := FDQUERY000.FieldByName('ID').ASINTEGER;
FDTbl8B.FieldByName('UOM').ASSTRING := FDQUERY000.FieldByName('UOM').ASstring;
FDTbl8B.FieldByName('COST').ASFLOAT := roundto(FDQUERY000.FieldByName('STDCOST').ASFLOAT,-4);
END
ELSE
SHOWMESSAGE('Part# not Found in Parts');
fdquery000.Close;
END
else
if (ACol = 4) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('UOM').ASSTRING := BOMITEMSGrid.Cells[Acol, Arow];
END
else
if (ACol = 5) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('QUANTITY').ASFLOAT := STRTOFLOAT(BOMITEMSGrid.Cells[Acol, Arow]);
FDQUERY0.Close;
fdquery0.Open;
IF fdquery0.locate('ID;DEFSITE', VARARRAYOF([FDTbl8b.FieldByName('PARTID').ASSTRING,FDTbl8b.FieldByName('DEFSITE').ASSTRING]),) THEN
FDTbl8B.FieldByName('COST').ASFLOAT := roundto(FDTbl8B.FieldByName('QUANTITY').ASFLOAT * FDquery0.FieldByName('STDCOST').ASFLOAT,-4)
ELSE
BEGIN
FDTbl8B.FieldByName('COST').ASFLOAT := 0;
END;
FDQUERY0.Close;
fg := True;
END
else
if (ACol = 6) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('MINQTY').ASFLOAT := STRTOFLOAT(BOMITEMSGrid.Cells[Acol, Arow]);
END
else
if (ACol = 7) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('MAXQTY').ASFLOAT := STRTOFLOAT(BOMITEMSGrid.Cells[Acol, Arow]);
END
else
if (ACol = 8) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('COST').ASFLOAT := roundto(STRTOFLOAT(BOMITEMSGrid.Cells[Acol, Arow]),-4);
fg := True;
END
else
if (ACol = 9) and (Arow = BOMITEMSGrid.FocusedCell.Row) then
BEGIN
FDTbl8B.FieldByName('INSTRUCTIONNOTE').ASSTRING := BOMITEMSGrid.Cells[Acol, Arow];
END;
BOMITEMSGrid.EndUpdate;

I was using this to update field values from grid to database. This is not working correctly as in fmx livegrid. Also, when the quantity field value change the footer value must update. However, when I use this TMSFNCGridDatabaseAdapter4.LoadAllDataAndDisconnect;
Footer updates but I cannot continue edit the grid values.

Is there a sample/demo that uses fncgrid with a active database connections?

There is a sample included in the distribution, in the installation directory under Demos. Unfortunatelying using LoadAllDataAndDisconnect will not allow you to edit the data in the grid. but footer calculations need the actual data. We are currently reworking this and will take this into account in our future developments. The best option is to actually address the dataset directly instead of using grid values, so this way you can keep the dataconnection active. Can you elaborate on what exactly is going wrong more in detail from the above code?