1

基本的に、クライアントは Delphi dxDBGrid の 1 行の色を変更したいと考えています。列のような行プロパティはありません。

何か案は?

4

3 に答える 3

3

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

于 2009-05-29T14:22:29.580 に答える
2

グリッドの OnCustomDrawCell イベントで使用します。

If ANode.Values[SomeColumnName.Index] = SomeValue then
  AFont.Color := clRed;

これは、参照している QuantumGrid v3 であると想定しています。v4以降の場合、cxStylesを指す答えは正しいです。

于 2009-05-29T16:11:22.240 に答える
2

申し訳ありませんが、OnCustomDraw イベントを使用してください。金曜日の朝。

于 2009-05-29T13:23:24.800 に答える