Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   TTabControl no ordena los datos de la TDBGrid (https://www.clubdelphi.com/foros/showthread.php?t=68257)

val3 03-06-2010 16:57:30

TTabControl no ordena los datos de la TDBGrid
 
Hola.

Estoy haciendo una agenda, y no logro que las tabs de un TTabControl ordenen los contactos que tengo una TDBGrid.

En el evento OnChange del TTabControl usé un case:

Código Delphi [-]
procedure TContacto.TC_ContactoChange(Sender: TObject);
begin
  case TC_Contacto.TabIndex of
    0: begin
      Modulo.Q_Contacto.Close;
      Modulo.Q_Contacto.SQL.Clear;
      Modulo.Q_Contacto.SQL.Add('select * from CONTACTO order by NOMBRE_CONTACTO');
      Modulo.Q_Contacto.Open;
    end;
    1: begin
      Modulo.Q_Contacto.Close;
      Modulo.Q_Contacto.SQL.Clear;
      Modulo.Q_Contacto.SQL.Add('select * from CONTACTO order by TELEFONO_CONTACTO');
      Modulo.Q_Contacto.Open;
    end;
    2: begin
      Modulo.Q_Contacto.Close;
      Modulo.Q_Contacto.SQL.Clear;
      Modulo.Q_Contacto.SQL.Add('select * from CONTACTO order by DIRECCION_CONTACTO');
      Modulo.Q_Contacto.Open;
    end;
    3: begin
      Modulo.Q_Contacto.Close;
      Modulo.Q_Contacto.SQL.Clear;
      Modulo.Q_Contacto.SQL.Add('select * from CONTACTO order by EMAIL_CONTACTO');
      Modulo.Q_Contacto.Open;
    end;
  end;
end;

Al ejecutar el programa, y apretar las tabs, no pasa nada.

Espero que me puedan dar una mano.

Gracias.

Neftali [Germán.Estévez] 04-06-2010 10:28:45

Ejecuta paso a paso y coloca un breakpoint al entrar en el procedimiento.
¿Pasa por ahí?
¿Cuando pasa qué valor tiene TabIndex?


La franja horaria es GMT +2. Ahora son las 13:24:09.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi