Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Como fazer um refresh a um IWDBGrid
#3
(10-11-2019, 05:41 PM)Jose Nilton Pace Wrote: Olá Cusco:
Code:
procedure RefreshIWGrid(zGrid: TIWDBGrid; Self: TIWAppForm);
begin
  zGrid.DoRefreshControl := True;
end;
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:
Code:
procedure RefreshIWGrid(zGrid: TIWDBGrid; Self: TIWAppForm);
begin
  zGrid.DoRefreshControl := True;
end;
Vou colocar aqui o meu exemplo para ver se alguém pode me ajudar: 
O meu IWDBGrid.OnRenderCell é assim: 

procedure TIWForm1.IWDBGrid1RenderCell(ACell: TIWGridCell; const ARow, AColumn: Integer);
begin
  if ARow > 0 then
  begin
    case AColumn of
      2:
      if Not Assigned(ACell.Control) then
      begin
        ACell.Control := TIWEdit.Create(Self);
        with TIWEdit(ACell.Control) do
         begin
             Name := 'MyEdit1'; // Nome único para cada linha
            Tag := fdmemtable1.FieldByName('codigo').AsInteger;
            OnAsyncExit := AsyncExitEvent;
         end;
      end;
  end;
end; 

of meu AsyncExitEvent é assim: 
procedure TIWForm1.AsyncExitEvent(Sender: TObject; EventParams: TStringList);
var
  FieldQtName: String;
begin
  FieldQtName := EventParams.Values['IW_Action'];
  fdmemtable1.Locate('codigo', tiwedit(sender).tag);
  fdmemtable1.Edit;
  fdmemtable1.FieldByName('nome').AsString := EventParams.Values[FieldQtName];
  fdmemtable1.Post;

  IWDBGrid1.DoRefreshControl := True;
end; 

O que me está acontecendo é que não existe o parâmetro com o nome MyEdit1 em EventParams, ou seja, EventParams deveria ter estes 2 parâmetros:
IW_Action=MYEDIT1 
MYEDIT1=?????????????????????? // O texto que eu introduzi

No intraweb 14 isto funcionava bem. Como posso acessar o valor que introduzi?
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)