Ver Mensaje Individual
  #5  
Antiguo 12-11-2006
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Reputación: 24
seoane Va por buen camino
Supongo que se estaban refiriendo a algo como esto:
Código Delphi [-]
var
  i,j: integer;
begin
  // StringGrid1 es el nombre de TStringGrid
  with StringGrid1 do 
    for i:= 0 to ColCount - 1 do
      for j:= 0 to RowCount - 1 do
        Cells[i,j]:= '';
end;

En el código anterior borramos todas las celdas, pero puede que no quieras borrar ni la primera fila ni la primera columna, entonces seria algo así:
Código Delphi [-]
var
  i,j: integer;
begin
  // StringGrid1 es el nombre de TStringGrid
  with StringGrid1 do 
    for i:= 1 to ColCount - 1 do
      for j:= 1 to RowCount - 1 do
        Cells[i,j]:= '';
end;

También podemos borrar filas enteras:
Código Delphi [-]
var
  j: integer;
begin
  with StringGrid1 do
      for j:= 0 to RowCount - 1 do
        Rows[j].Clear;
end;
Responder Con Cita