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 "/> - +