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:
void __fastcall TForm1:
BGrid1DrawColumnCell(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.
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:
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.