Ver Mensaje Individual
  #2  
Antiguo 12-11-2005
Avatar de Héctor Randolph
[Héctor Randolph] Héctor Randolph is offline
Miembro Premium
 
Registrado: dic 2004
Posts: 882
Reputación: 20
Héctor Randolph Va por buen camino
Hola lavtaro.

Aqui tienes dos opciones:

La primera es usar el evento OnCellClick y verificar el nombre del campo asociado a la columna

Código Delphi [-]
procedure TForm1.DBGrid1CellClick(Column: TColumn);
begin
  if Column.FieldName='MiCampo' then
    //Tú código aquí
  else if Column.FieldName='OtroCampo' then
    //Más código
end;

La segunda es usar el evento OnDblClick

Código Delphi [-]
procedure TForm1.DBGrid1DblClick(Sender: TObject);
var
  Campo: String;
begin
  Campo:=TDBGrid(Sender).SelectedField.FieldName;
  if Campo='MiCampo' then
    //Codigo
  else
  if Campo='OtroCampo' then
   //Codigo
end;

Espero que sea útil, un saludo
Responder Con Cita