From d7e17fd78790fc0773bf9d53b73b7602c127672e Mon Sep 17 00:00:00 2001 From: david Date: Tue, 4 Nov 2008 18:01:45 +0000 Subject: [PATCH] =?UTF-8?q?Inventario:=20creaci=C3=B3n=20de=20pesta=C3=B1a?= =?UTF-8?q?s=20de=20almacenes/obras=20un=20poco=20m=C3=A1s=20r=C3=A1pida.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@728 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- .../Inventario/Views/uViewInventario.dfm | 2 +- .../Inventario/Views/uViewInventario.pas | 50 +++++++++++-------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/Source/Modulos/Inventario/Views/uViewInventario.dfm b/Source/Modulos/Inventario/Views/uViewInventario.dfm index 356e7951..7b935b25 100644 --- a/Source/Modulos/Inventario/Views/uViewInventario.dfm +++ b/Source/Modulos/Inventario/Views/uViewInventario.dfm @@ -3,7 +3,7 @@ inherited frViewInventario: TfrViewInventario RootLevelOptions.DetailTabsPosition = dtpTop OnActiveTabChanged = cxGridActiveTabChanged inherited cxGridView: TcxGridDBTableView - DataController.KeyFieldNames = 'ID_ALMACEN; ID_ARTICULO' + DataController.KeyFieldNames = 'RECID' DataController.Summary.DefaultGroupSummaryItems = < item Format = ',0.00 '#8364';-,0.00 '#8364 diff --git a/Source/Modulos/Inventario/Views/uViewInventario.pas b/Source/Modulos/Inventario/Views/uViewInventario.pas index 43df3f17..3e2a123a 100644 --- a/Source/Modulos/Inventario/Views/uViewInventario.pas +++ b/Source/Modulos/Inventario/Views/uViewInventario.pas @@ -166,17 +166,22 @@ begin if Assigned(FAlmacenes) then begin - cxGridLevel.Caption := 'Todos los almacenes'; - if not FAlmacenes.DataTable.Active then - FAlmacenes.DataTable.Active := True; + cxGrid.BeginUpdate; + try + cxGridLevel.Caption := 'Todos los almacenes'; + if not FAlmacenes.DataTable.Active then + FAlmacenes.DataTable.Active := True; - FAlmacenes.First; - while not FAlmacenes.EOF do - begin - Nivel := cxGrid.Levels.Add; - Nivel.Caption := FAlmacenes.NOMBRE; - Nivel.Tag := FAlmacenes.ID; - FAlmacenes.Next; + FAlmacenes.First; + while not FAlmacenes.EOF do + begin + Nivel := cxGrid.Levels.Add; + Nivel.Caption := FAlmacenes.NOMBRE; + Nivel.Tag := FAlmacenes.ID; + FAlmacenes.Next; + end; + finally + cxGrid.EndUpdate; end; end; end; @@ -198,17 +203,22 @@ begin if Assigned(FObras) then begin - cxGridLevel.Caption := 'Todos las obras'; - if not FObras.DataTable.Active then - FObras.DataTable.Active := True; + cxGrid.BeginUpdate; + try + cxGridLevel.Caption := 'Todos las obras'; + if not FObras.DataTable.Active then + FObras.DataTable.Active := True; - FObras.First; - while not FObras.EOF do - begin - Nivel := cxGrid.Levels.Add; - Nivel.Caption := FObras.NOMBRE; - Nivel.Tag := FObras.ID; - FObras.Next; + FObras.First; + while not FObras.EOF do + begin + Nivel := cxGrid.Levels.Add; + Nivel.Caption := FObras.NOMBRE; + Nivel.Tag := FObras.ID; + FObras.Next; + end; + finally + cxGrid.EndUpdate; end; end; end;