Delphi - Recover code on Dbgrid after registration

Asked

Viewed 43 times

0

Hello !

I have a Dbgrid connected to the temporary table (Tfdmemtable) with data of products that were imported from an XML and from a product I call at runtime the product registration form filling some fields, how it could be done for dbgrid to be updated with the code and description of this registered product after recording the product in the Firebird database, so that I can link this product from the supplier to the product.

procedure TfrmVinculaProduto.btnCadastraProdutoClick(Sender: TObject);
begin
  FrmProdutos := TFrmProdutos.Create(Self);
  FrmProdutos.DoubleBuffered := True;
  FrmProdutos.WindowState := wsMaximized;
  FrmProdutos.FrmFrameBotoes1.SpbAdicionarClick(Sender);

  FrmProdutos.DBEditDescricao.Text := mtVinculaItemDESCRICAO.AsString;
  FrmProdutos.DBEdit_CodigoBarra.Text := mtVinculaItemEAN.AsString;
  FrmProdutos.EditCodigoFabricante.Text := mtVinculaItemPRODUTO.AsString;
  FrmProdutos.DBEdit_PrcCusto.Text := FormatFloat('###,###,##0.00',
  mtVinculaItemVL_UNITARIO.AsFloat);



  FrmProdutos.ShowModal;
end;
  • just update the record directly on your Tfdmemtable, with Edit and Post that the grid will update

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.