Grid

Delphi

25/07/2003

Alguém poderia me Ajudar.
Preciso modificar a cor apenas de algumas células de um grid que satisfaçam uma determinada condição e não deixar que sejam digitados valores nestas células.

Obrigada,


Lgarcia

Lgarcia

Curtidas 0

Respostas

Joaomw

Joaomw

25/07/2003

No Evento OnDrawCell
With SGrid.Canvas do
begin
//Pinta Células****************
if (ACol=0) and (ARow<>13)
then Brush.Color := clCream
else Brush.Color := clWhite;
FillRect(Rect);
end;

//somente leitura
no evento SGridSelectCell
begin
if (ARow>0) and (ARow<13) and (ACol=1)
then
begin
SGrid.Options := SGrid.Options + [goEditing];
SGAreaPlan.DefaultDrawing := True;
end
else
begin
SGrid.Options := SGrid.Options - [goEditing];
SGrid.DefaultDrawing := False;
end;
end;

Caso não funcione me fale que eu explico.


GOSTEI 0
POSTAR