hansaplast
Programmer
Hi,
I'm trying to change the rowlines color in the TDBGrid object.
I've already tried to use the OnDrawColumnCell prop. But than I can only change datacells, not the fixed ones. What I would like is a datagrid without the gray lines around the cells. But I do want the fixed cels (1st row) to be "button" like.
Here is the OnDrawColumnCell function:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
with DBGrid1 do
begin
Canvas.Pen.Color := clWindow; // RowLine color
Canvas.Brush.Style := bsClear;
Canvas.MoveTo(Rect.Left, Rect.Top);
Canvas.LineTo(Rect.Right, Rect.Top);
Canvas.Pen.Color := clWindow; // ColLine color
Canvas.MoveTo(Rect.Left, Rect.Top);
Canvas.LineTo(Rect.left, Rect.Bottom);
end;
end;
// Options dgColLines and dgRowLines must be false
I could realy use some help.
I'm trying to change the rowlines color in the TDBGrid object.
I've already tried to use the OnDrawColumnCell prop. But than I can only change datacells, not the fixed ones. What I would like is a datagrid without the gray lines around the cells. But I do want the fixed cels (1st row) to be "button" like.
Here is the OnDrawColumnCell function:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
with DBGrid1 do
begin
Canvas.Pen.Color := clWindow; // RowLine color
Canvas.Brush.Style := bsClear;
Canvas.MoveTo(Rect.Left, Rect.Top);
Canvas.LineTo(Rect.Right, Rect.Top);
Canvas.Pen.Color := clWindow; // ColLine color
Canvas.MoveTo(Rect.Left, Rect.Top);
Canvas.LineTo(Rect.left, Rect.Bottom);
end;
end;
// Options dgColLines and dgRowLines must be false
I could realy use some help.