![]() |
Como fazer um refresh a um IWDBGrid - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: Português (https://www.atozed.com/forums/forum-5.html) +----- Forum: IntraWeb Dúvidas Gerais (https://www.atozed.com/forums/forum-17.html) +----- Thread: Como fazer um refresh a um IWDBGrid (/thread-1307.html) |
Como fazer um refresh a um IWDBGrid - Cusco69 - 10-11-2019 Com a versão 14 do Intraweb, eu usava este procedimento para refrescar um IWDBGrid com Cell.Control para editar algumas colunas: procedure RefreshIWGrid(zGrid: TIWDBGrid; Self: TIWAppForm);//2011-04-19 IW 11 version var zPageContext: TIWBasePageContext; LControlRenderData: TIWHTMLTag; LControlContext: TIWCompContext; LContainerContext: TIWContainerContext; begin zPageContext := Self.PageContext; LContainerContext := HTML40ContainerInterface(TIWDBGrid(zGrid)).ContainerContext; //2010-05-12 if you get A/v here, it is because renderinvisible controls on th eform is set to false! LControlContext := TIWCompContext.Create(zGrid, LContainerContext, zPageContext); // LControlRenderData := IIWHTML40Component(zGrid).RenderHTML(LControlContext); try LControlRenderData.AddParmsList(zGrid.ExtraTagParams); LControlContext.HTMLTag := LControlRenderData; zGrid.RefreshData(LControlContext, LControlRenderData); finally //if assigned(LControlRenderData) then//Don't free this, the controlcontext frees it //LControlRenderData.Free; if assigned(LControlContext) then//2011-01-25 Memory leak LControlContext.Free; end; // Self.AddToInitProc('FixDBGridHeaders(''' + zGrid.HTMLName + ''');'); end; e funcionava lindamente. Com a versão 15 do Intraweb estou a obter um AV na linha: LControlRenderData := IIWHTML40Component(zGrid).RenderHTML(LControlContext); e os dados não completamente refrescados. Já dei voltas e voltas e não consigo perceber porquê. O que mudou no Intraweb 15 para que isto tenha deixado de funcionar? Obrigado RE: Como fazer um refresh a um IWDBGrid - Jose Nilton Pace - 10-11-2019 Olá Cusco: Code: procedure RefreshIWGrid(zGrid: TIWDBGrid; Self: TIWAppForm); RE: Como fazer um refresh a um IWDBGrid - Cusco69 - 10-11-2019 (10-11-2019, 05:41 PM)Jose Nilton Pace Wrote: Olá Cusco:Olá Jose, realmente seu código funciona mas algo falha no refresh no que diz respeito aos componentes que tenho em algumas células. Não estou a conseguir ter acesso aos conteúdos dos campos TIWEdit que estão numa determina coluna. Será que podia enviar-lhe um pequeno exemplo para ver do que falo? Obrigado. Eu preciso passar o valor que recolho nos TIWEdit das colunas para o Intraweb para poder alterar a minha tabela. (10-11-2019, 06:04 PM)Cusco69 Wrote:(10-11-2019, 05:41 PM)Jose Nilton Pace Wrote: Olá Cusco:Vou colocar aqui o meu exemplo para ver se alguém pode me ajudar: |