From d2615e526b65ee8f4da579288d246b77304dc475 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Tue, 8 May 2012 14:14:10 +0000 Subject: [PATCH] fix cacl footer row in rxDBGrid git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2422 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/rxdbgrid.pas | 15 +++++++++++++-- components/rx/rxnew.lpk | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/components/rx/rxdbgrid.pas b/components/rx/rxdbgrid.pas index f8182e330..3b075c870 100644 --- a/components/rx/rxdbgrid.pas +++ b/components/rx/rxdbgrid.pas @@ -409,6 +409,7 @@ type FAfterQuickSearch: TRxQuickSearchNotifyEvent; FBeforeQuickSearch: TRxQuickSearchNotifyEvent; FQuickUTF8Search: string; + FOldDataSetState:TDataSetState; procedure DoCreateJMenu; function GetColumns: TRxDbGridColumns; @@ -2820,7 +2821,7 @@ begin if FInProcessCalc < 0 then begin FInProcessCalc := 0; - CalcStatTotals; + UpdateFooterRowOnUpdateActive; end else if Assigned(FFooterOptions) and FFooterOptions.Active and (FFooterOptions.RowCount > 0) and @@ -3306,7 +3307,17 @@ end; procedure TRxDBGrid.UpdateFooterRowOnUpdateActive; begin - // + if Assigned(DataSource) then + begin + if DataSource.State <> FOldDataSetState then + begin + if (FOldDataSetState in dsEditModes) and (DataSource.State = dsBrowse) then + CalcStatTotals; + FOldDataSetState:=DataSource.State; + end; + end + else + FOldDataSetState:=dsInactive; end; procedure TRxDBGrid.GetOnCreateLookup; diff --git a/components/rx/rxnew.lpk b/components/rx/rxnew.lpk index f7999f135..e0f94ea32 100644 --- a/components/rx/rxnew.lpk +++ b/components/rx/rxnew.lpk @@ -26,7 +26,7 @@ Copyright (c) 1998 Master-Bank translate to Lazarus by alexs in 2005 - 2012 "/> - +