Tengo dos TwwDbgrid (InfoPower4000 de WollToWoll Software) y necesito "pasar" de una a otra una serie de registros de una de las rejillas, los cuales se "marcarán" y usando el ratón, arrastrados y depositados en la otra para ser INSERTADAS en la tabla que es representada en ésta rejilla; ésto es debido a que se requiere agilizar la definición de una serie de parámetros.
El código que "recibe" el proceso de "soltar en la segunda rejilla" (que en éste momento sólo acepta UN registro a la vez) lo tengo actualmente así:
delphi
procedure TfrmRubrosSIS.grdReporteDragDrop(Sender, Source: TObject; X, Y: Integer); function GetGenreLabel(sEtiqueta: string) : string; begin with TADOQuery.Create(Self) do try Connection := cnxConexion; with SQL do begin Add('SELECT C_SIS_CLAVE_GENERO'); Add('FROM C_SIS_CLAVE'); Add('WHERE C_SIS_CLAVE_SIS_ID = '+QuotedStr(sEtiqueta)); end; Open; GetGenreLabel := IntToStr(FieldByName('C_SIS_CLAVE_GENERO').AsInteger); finally Close; Free; end; end; begin with TADOQuery.Create(Self) do try Connection := cnxConexion; with SQL do begin Add('INSERT INTO C_SIS_SS_AUXILIAR'); Add( '(C_SIS_CODIGO_MATRIZ'); Add( ',C_SIS_CLAVE_SIS'); Add( ',C_SIS_GENERO'); Add( ',E4_SERVICIO_ID'); Add( ',E4_SRV_DETALLE_ID)'); Add( 'VALUES ('); Add( QuotedStr(cmbxReporte.Value)); Add( ','+QuotedStr(cmbxEtiquetaSIS.Value)); Add( ','+GetGenreLabel(cmbxEtiquetaSIS.Value)); Add( ','+QuotedStr(QryServiciosE4_SERVICIO_ID.AsString)); Add( ','+IntToStr(QryServiciosE4_SRV_DETALLE_ID.AsInteger)); Add( ')'); end; ExecSQL; finally Free; end; QryData001.Requery; QryServicios.Requery; end;
Y que deberá prepararse para "recibir" más de un registro a la vez.
¿Alguna idea, código, orientación que me sirva para cumplimentar ésto?