uViewGridBase: liberación correcta en método SaveGridStatus.

uEditorGridBase: Mejorado el método RefrescarInterno.

git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@269 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
David Arranz 2008-07-10 16:00:39 +00:00
parent f067420216
commit 376332c3d4
2 changed files with 6 additions and 8 deletions

View File

@ -283,21 +283,17 @@ begin
end; end;
procedure TfEditorGridBase.RefrescarInterno; procedure TfEditorGridBase.RefrescarInterno;
var
FocusedRow, TopRow : Integer;
begin begin
TopRow := ViewGrid._FocusedView.Controller.TopRowIndex;
FocusedRow := ViewGrid._FocusedView.DataController.FocusedRowIndex;
ViewGrid._FocusedView.BeginUpdate;
ShowHourglassCursor; ShowHourglassCursor;
ViewGrid.SaveGridStatus;
ViewGrid._FocusedView.BeginUpdate;
try try
// inherited; <- No hacemos lo que hay en el padre // inherited; <- No hacemos lo que hay en el padre
dsDataTable.DataTable.Refresh; dsDataTable.DataTable.Refresh;
finally finally
ViewGrid._FocusedView.EndUpdate; ViewGrid._FocusedView.EndUpdate;
ViewGrid._FocusedView.DataController.FocusedRowIndex := FocusedRow; ViewGrid.RestoreGridStatus;
ViewGrid._FocusedView.Controller.TopRowIndex := TopRow;
HideHourglassCursor; HideHourglassCursor;
end; end;
end; end;

View File

@ -321,7 +321,9 @@ end;
procedure TfrViewGridBase.SaveGridStatus; procedure TfrViewGridBase.SaveGridStatus;
begin begin
FreeAndNil(FGridStatus); if Assigned(FGridStatus) then
FreeAndNil(FGridStatus);
if not IsEmpty then if not IsEmpty then
FGridStatus := TcxGridStatus.Create(_FocusedView); FGridStatus := TcxGridStatus.Create(_FocusedView);
end; end;