Ver Mensaje Individual
  #1  
Antiguo 12-10-2006
Arturo Arturo is offline
Miembro
 
Registrado: sep 2004
Posts: 91
Reputación: 20
Arturo Va por buen camino
como eliminar una fila del stringGrid.

saludos, disculpen pero esto ingresando datos en un stringGrid para despues ser tomados e ingresarlos por medio de sentencias sql insert... ahora no se como arregrar el asunto de una vez que tengo los datos en el stringGrid quisiera borrar alguno y este es el codigo que tengo:
Código PHP:
los encabezados son estos:

mis encabezados del   StringGrid1son de esta forma que son los 4 campos  StringGrid1.Cells[0,0]:='Id';
 
StringGrid1.Cells[1,0]:='Descripcion';
 
StringGrid1.Cells[2,0]:='Especificacion';
 
StringGrid1.Cells[3,0]:='Iva'
procedure  eliminiar; var
    
:  integer;
begin
    
if(iNumero <> - 1then begin //nada mas verifica  que haiga regsitrso en el stringgrid          if(Application.MessageBox('¿Desea eliminar el artículo  seleccionado?','Eliminar',
                                      
mb_OK +  mb_Cancel ) = smbOKthen begin
            
for := stringGrid1.Row to  stringGrid1.RowCount do begin
                stringGrid1
.Cells[0,i+1] :=  IntToStr(StrToInt(stringGrid1.Cells[0,i+1]) - 1);
                 
stringGrid1.Rows[i] := stringGrid1.Rows[i+1];
                            
end;
            if(
stringGrid1.RowCount 2then  begin
                stringGrid1
.RowCount := stringGrid1.RowCount -  1;
                          
end
            
else begin
                 stringGrid1
.Cells[0,1] := '';
                
stringGrid1.Cells[1,1] :=  '';
                
stringGrid1.Cells[2,1] := '';
                 
stringGrid1.Cells[3,1] := '';
           
end;
            
iNumero :=  iNumero 1;
              
end;
     
end;
    
txtCodigo.SetFocus;
end;

pero me borrar pero el campo del stringGridStringGrid1.Cells[0,0]:='Id'si tengo un valos por decirlo 6 me decrementa en uno me debe de respetar
gracias.
Responder Con Cita