TreeDataGrid performance is driven by presenter virtualization and control recycling.
The main pipeline is:
TreeDataGridPresenterBase<TItem>: virtualized realization base.TreeDataGridColumnarPresenterBase<TItem>: column-aware layout and width commit.At runtime presenters:
BringIntoView(index) can realize a non-visible target temporarily to force accurate scroll positioning.
Column presenters can run two measure passes:
This is important for star/auto sizing and avoids layout drift between headers and cells.
// Scroll to row 10_000 without forcing realization of all previous rows.
var row = grid.RowsPresenter?.BringIntoView(10_000) as TreeDataGridRow;
row?.Focus();
// Ensure a specific column is visible.
grid.ColumnHeadersPresenter?.BringIntoView(8);
Common symptoms and causes:
high allocation while scrolling Cause: custom templates/factory prevent effective recycle reuse.
stale selection visuals on reused rows/cells Cause: custom control keeps per-row state that is not reset on realize/unrealize.
wrong column widths after dynamic updates Cause: custom column implementation does not correctly implement layout update contract.
Feature behavior differs from expectations
Cause: one or more options in this scenario are configured differently (source type, column options, sort/selection/edit state).
Fix: compare your setup with the snippet in this article and verify runtime values on Source, Columns, and Selection.
Data changes are not visible in UI
Cause: model or collection notifications are missing, or a replaced collection/source is not re-bound.
Fix: ensure INotifyPropertyChanged/INotifyCollectionChanged flow is active and reassign Source after replacing underlying collections.