<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Comments for Colors in DBGrid</title>
<link rel="alternate" type="text/plain" href="http://edn.embarcadero.com/article/26945" title="Colors in DBGrid" />
<link rel="self" type="application/atom+xml" href="http://edn.embarcadero.com/article/26945/feed" title="Comments for Colors in DBGrid" />
<id>http://edn.embarcadero.com/article/26945</id>
<updated>2009-11-08T02:00:14-08:00</updated>
<entry>
<title>Colors in DBGrid</title>
<author>
<name>Craven Weasel</name>
<uri>http://threads.embarcadero.com/threads/threads.exe/userall?commentid=30357</uri>
</author>
<id>http://threads.embarcadero.com/threads/threads.exe/view?commentid=30357</id>
<updated>2001-10-23T08:16:51-07:00</updated>
<published>2001-10-23T08:16:51-07:00</published>
<summary>Colors in DBGrid</summary>
<content>Testing in Delphi 6.I had to prefix the Default ..... function to get it function.i.e.DBGrid1.DefaultDrawColumnCell (.........)RegardsKA </content>
</entry>
<entry>
<title>re: Colors in DBGrid</title>
<author>
<name>Klaus Edelmann</name>
<uri>http://threads.embarcadero.com/threads/threads.exe/userall?commentid=30334</uri>
</author>
<id>http://threads.embarcadero.com/threads/threads.exe/view?commentid=30334</id>
<updated>2001-10-22T03:43:15-07:00</updated>
<published>2001-10-22T03:43:15-07:00</published>
<summary>re: Colors in DBGrid</summary>
<content>procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;  DataCol: Integer; Column: TColumn; State: TGridDrawState);begin    if TDBGrid(Sender).DataSource.DataSet.RecNo mod 2 = 0 then      TDBGrid(Sender).Canvas.Brush.Color := clWindow    else      TDBGrid(Sender).Canvas.Brush.Color := clInfoBk;    end;    DefaultDrawColumnCell(Rect, DataCol, Column, State);  end;end;</content>
</entry>
<entry>
<title>Colors in DBGrid</title>
<author>
<name>Craven Weasel</name>
<uri>http://threads.embarcadero.com/threads/threads.exe/userall?commentid=30333</uri>
</author>
<id>http://threads.embarcadero.com/threads/threads.exe/view?commentid=30333</id>
<updated>2001-10-21T23:01:42-07:00</updated>
<published>2001-10-21T23:01:42-07:00</published>
<summary>Colors in DBGrid</summary>
<content>tried this code:(table is TApolloTable in Delhi6) procedure TfPlan.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;  DataCol: Integer; Column: TColumn; State: TGridDrawState);begin  with (Sender as TDBGrid).Canvas do  begin     if (tPlanradSTAT.AsInteger = 1) or        (tPlanradSTAT.AsInteger = 2) or        (tPlanradSTAT.AsInteger = 8) then     begin        Brush.Color := clRed;        Font.Color := clBlack;     end     else     begin        Brush.Color := clWhite;        Font.Color  := clRed;     end;  end;end;when DefaultDrawing set to False I can see the rows butwithout contents.What have I been missing?Kurt.Anneborg@swipnet.se</content>
</entry>
<entry>
<title>Colors in DBGrid</title>
<author>
<name>Didier Largange</name>
<uri>http://threads.embarcadero.com/threads/threads.exe/userall?commentid=30188</uri>
</author>
<id>http://threads.embarcadero.com/threads/threads.exe/view?commentid=30188</id>
<updated>2001-10-11T04:52:06-07:00</updated>
<published>2001-10-11T04:52:06-07:00</published>
<summary>Colors in DBGrid</summary>
<content>Ok, but how can it have alternated row colors ?</content>
</entry>
<entry>
<title>Colors in DBGrid</title>
<author>
<name>Juergen Schwarze</name>
<uri>http://threads.embarcadero.com/threads/threads.exe/userall?commentid=30018</uri>
</author>
<id>http://threads.embarcadero.com/threads/threads.exe/view?commentid=30018</id>
<updated>2001-09-26T16:51:37-07:00</updated>
<published>2001-09-26T16:51:37-07:00</published>
<summary>Colors in DBGrid</summary>
<content>You should change the call of DefaultDrawDataCell to DefaultDrawColumnCell.</content>
</entry>
</feed>
