sábado, 12 de mayo de 2007

stringgrid

//******************************************************
procedure TForm11.Button2Click(Sender: TObject);
begin

stringgrid1.rowcount:=30; // numero de filas del grid
//stringgrid1.Row:=10;


//stringgrid1.ColWidths[1]:=10;

stringgrid1.Cells[1,0]:='holaaaaaaaaaaaaaa';
stringgrid1.Cells[1,1]:='holaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
stringgrid1.Cells[2,2]:='holaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
stringgrid1.Cells[3,3]:='hola';
stringgrid1.Cells[4,4]:='hola';
stringgrid1.Cells[5,5]:='hola';
stringgrid1.Cells[6,6]:='hola';
stringgrid1.Cells[7,7]:='holaaaaaaaaaaaaaaaaaaa';
stringgrid1.Cells[8,8]:='hola';


end;



//********

stringgrid1.Visible:=true;
stringgrid1.rowcount:=a;

stringgrid1.Cells[1,0]:='ID';
stringgrid1.Cells[2,0]:='Nombre';
stringgrid1.Cells[3,0]:='Apellido';
stringgrid1.Cells[4,0]:='Turno';


// tamaño de columna
stringgrid1.ColWidths[1]:=10;




//***********
para q no deje editar una celda y las demas si

procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
begin



if (acol = 2) and (arow = 1) then
StringGrid1.Options :=StringGrid1.Options-[goediting]
else
StringGrid1.Options :=StringGrid1.Options+[goediting];

end;

No hay comentarios: