すべてはタイトルにあります。行ごとにカスタマイズ可能な Officehint を作成するにはどうすればよいでしょうか。行上で mousemove を実行すると、このレコードの情報が表示されます (db クエリから)。
ありがとう
CellProperties
グリッドのプロパティを使用して、個々のセルに色を付けることができます。これを使用して、行全体に色を付けることができます。
var
RowIndex: Integer;
ColIndex: Integer;
with MyDBAdvGrid do
begin
// you choose the row index; you may want to iterate all rows to
// color each of them
RowIndex := 2;
// now iterate all (non-fixed, visible) cells in the row and color each cell
for ColIndex := FixedCols to ColCount - 1 do
begin
CellProperties[ColIndex, RowIndex].BrushColor := clYellow;
CellProperties[ColIndex, RowIndex].FontColor := clGreen;
end;
end;
オフィスのヒントを記録データで埋めるには、ユーザーがマウスを動かしたときに更新することをお勧めします。関数を使用しMouseToCell
てマウスの下の行と列を取得し、次に を使用MyDBAdvGrid.AllCells[ColIndex, RowIndex]
してセルの内容にアクセスします。
ハインリッヒの答えに代わるものは、OnGetCellColor
イベントを使用することです。
これは次のように使用できます。
procedure TDBAdvGrid.DBGridGetCellColor(Sender: TObject; ARow,
ACol: Integer; AState: TGridDrawState; ABrush: TBrush; AFont: TFont);
begin
if (your condition) then ABrush.Color := clRed;
end;
ヒントについても同様です。
procedure TDBAdvGrid.DBGridGridHint(Sender: TObject; ARow, ACol: Integer;
var hintstr: String);
begin
hintstr := 'your hint text';
end;