Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RowLines color in TDBGrid

Status
Not open for further replies.

hansaplast

Programmer
Dec 17, 2001
61
NL
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 think this faq (for the Delphi forum) answers your question:
faq102-2231

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top