Re: Color row of DBGrid
- From: "FrancoJommi" <franco.jommi@xxxxxx>
- Date: Wed, 4 Jul 2007 10:02:34 +0200
Would you share what you have done or give guidance on how to do it ?
"Fons" <fonzzzNO@xxxxxxxxxxxxxxxxxxx> ha scritto nel messaggio
news:468ab710$0$336$e4fe514c@xxxxxxxxxxxxxxxxx
first
I change color of the 'current' record in a DBGrid using the
OnDrawColumnCell eventi with the following code:
if (gdFocused in State) or (gdSelected in State) then
begin
if BtnMod.Down then
MyDBGrid.Canvas.Brush.Color := clYellow
else
MyDBGrid.Options := DelegheDBGrid.Options + [dgRowSelect];
MyDBGrid.DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
The problem I have is that it doesn't work exactly as I wanted. The
true.time I show the DBGrid no record are hilighted though dgRowSelect is
sinceClicking on the BtnMod the focused row is correctly painted in yellow,
recorddgRowSelect is true. But I need dgRowSelect to be false to edit the
Options.and if it is set to false, the cells are not painted in yellow.
I think you should do ALL the drawing of the cells in OnDrawColumnCell.
I have written a program with a grid with user-chosen colors, crosses in
colored cells etc. Most of the standard drawing, not different from a
standard grid is simple; that's not too much work.
I think it doesn't work with just changing the Brush.Color and the
Thanks in advance for any suggestions.
Fons.
.
- Follow-Ups:
- Re: Color row of DBGrid
- From: Fons
- Re: Color row of DBGrid
- References:
- Re: Color row of DBGrid
- From: Fons
- Re: Color row of DBGrid
- Prev by Date: Re: Working with windows handles
- Next by Date: Re: Color row of DBGrid
- Previous by thread: Re: Color row of DBGrid
- Next by thread: Re: Color row of DBGrid
- Index(es):