It's much easier to give color to DBGrids. Here you have to use the "OnDrawColumnCell"-Event. The following example is coloring the Cells of Column "Status" when the value is not "a".
If you want to color the whole line you only have to delete the "If..." statement (see below)
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn;
clPaleGreen = TColor($CCFFCC);
clPaleRed = TColor($CCCCFF);
If Column.FieldName = 'Status' then //Remove this line, if you want
//to highlight the whole line
If Column.Field.Dataset.FieldbyName('Status').AsString 'a'
If (gdFocused in State) //does the cell have the focus?
then dbgrid1.canvas.brush.color := clBlack //focused
else dbgrid1.canvas.brush.color := clPaleGreen; //not focused
//Now let's paint the cell using a Default-Method:
A portal that has dedication and concentration in the development of computer programming and more
resource for help people such as open project, jobs, question & answer, additional tools, and many more.
Collection of various kinds of code programming language from desktop to web programming.