12

Firemonkeyのグリッド実装を調べたところ、非常に単純な実装であることがわかりました(グリッド実装にはあまりないように見える1800行のみ)。カスタムペイントはほとんど行いませんが、代わりに他の多くのコントロールを集約します。これは、Firemonkeyスタイルの操作のようです。

たとえば、各列には、セルごとに1つずつ、コントロールの配列が保持されます。1,000,000行の通常のテキスト列の場合、グリッドは1,000,000の編集コントロールをメモリに保持します。これは私には少しおかしなことに思えます。(編集:その仮定が正しいかどうかは今のところよくわかりません。セルの可視性が考慮されているようです。つまり、仮想モードのようなものを提供している可能性がありますが、よくわかりません...

私の質問:間違いなく、Firemonkeyのこのコンポーネント集約設計はシンプルでエレガントに見えますが、グリッドに表示する必要のあるデータの量に応じて実際に適切に拡張できますか?多数の行でうまく機能することは想像できません。大量のデータを処理するFiremonkeyの方法は何ですか?

ご入力いただきありがとうございます。

4

1 に答える 1

11

The FireMonkey grid only has controls for the number of visible lines. So if you have a grid with 10 visible rows and 3 columns, it will create 30 cell controls. Filling the grid with 10.000 records is no problem: when you scroll the 30 cell controls are reused and mapped to the new visible rows.

And yes: I did some tests with this because we have TMS grids with 100.000 records :-).

If you use OnGetCellText (so not TStringgrid, which is very slow with lots of records, especially TMS grid (based in VCL stringgrid)) it is very fast (OnGetCellText only retrieves data of visible cells). We use this technique in combination with our data objects (these are already loaded, so no need to fill each cell of the grid with the string value again...) and both TMS and FMX grids are very fast with 100.000 records or more!

于 2011-09-19T13:03:10.580 に答える