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 Mike Lewis 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
0
0
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:

void __fastcall TForm1::DBGrid1DrawColumnCell(TObject *Sender,
const TRect &Rect, int DataCol, TColumn *Column, TGridDrawState State)
{
TCanvas *Canvas = DBGrid1->Canvas;

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);
}
// Options dgColLines and dgRowLines must be false

I could realy use some help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top