UniGUI 如何进行 UniDBGrid 的单元 Cell 的计算 ?

来源:http://forums.unigui.com/index.php?/topic/10508-update-dataset-events-in-unidbgrid/?hl=unidbgrid

I test these code with 1.10.0.1456,maybe work for you.

write code in UniDBGrid's OnSetCellValue  event

 

 

procedure TMainForm.UniDBGrid1SetCellValue(Sender: TObject; ACol,
  ARow: Integer; AField: TField; var Value: Variant);
begin
  self.UniDBGrid1.DataSource.DataSet.Edit;
  self.UniDBGrid1.DataSource.DataSet.FieldByName(self.UniDBGrid1.Columns.Items[Acol].FieldName).Value:=Value;
  self.UniDBGrid1.DataSource.DataSet.Post;
end;

 

posted @ 2018-07-20 00:05  Hopesun  阅读(735)  评论(0编辑  收藏  举报