Basically a client wants to change the color of a single row in a Delphi dxDBGrid. There isn't a rows property like there is columns.
Any ideas?
Basically a client wants to change the color of a single row in a Delphi dxDBGrid. There isn't a rows property like there is columns.
Any ideas?
You can use styles. The DevExpres Grid in DBTableView has a event named: OnGetContentStyle in Styles part.
You can create at design two styles and apply the desired style at runtime.
procedure TFormBrBase.DBTableViewStylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
With ARecord you can access to the actual record values. With this values you decide and change the value of the AStyle(out) param. This line is painted with this style.
Greetings.
Neftalí
Germán Estévez
I use on the grid's OnCustomDrawCell event, eg:
If ANode.Values[SomeColumnName.Index] = SomeValue then
AFont.Color := clRed;
This is assuming it is the QuantumGrid v3 you're referring to. If it's v4 or later then the answer pointing you at cxStyles is correct.