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
i : integer;
begin
if(iNumero <> - 1) then begin //nada mas verifica que haiga regsitrso en el stringgrid if(Application.MessageBox('¿Desea eliminar el artículo seleccionado?','Eliminar',
mb_OK + mb_Cancel ) = smbOK) then begin
for i := stringGrid1.Row to stringGrid1.RowCount - 2 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 > 2) then 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 stringGrid, StringGrid1.Cells[0,0]:='Id'; si tengo un valos por decirlo 6 me decrementa en uno me debe de respetar.
gracias.