Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Como fazer um refresh a um IWDBGrid
#1
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
Reply


Messages In This Thread
Como fazer um refresh a um IWDBGrid - by Cusco69 - 10-11-2019, 05:23 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)