Update docs for TreeDataGrid 12.#924
Conversation
Async just complicates the sample.
There was a problem hiding this comment.
Pull request overview
Updates the TreeDataGrid documentation set to reflect the TreeDataGrid v12 API refactor and the new recommended workflows (XAML-defined columns and fluent code-behind column creation), and adds a dedicated v12 migration/breaking-changes page.
Changes:
- Reworks TreeDataGrid docs to use the v12-style XAML column definitions and fluent column builder APIs.
- Adds/updates guidance for selection, sorting, filtering, and expand/collapse behavior under the v12 model.
- Introduces a new “TreeDataGrid v12 breaking changes” document and links it from navigation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| controls/data-display/structured-data/treedatagrid/sorting.md | Updates sorting guidance/examples for v12 patterns (XAML columns + fluent options). |
| controls/data-display/structured-data/treedatagrid/selection-modes.md | Adds XAML selection mode guidance and updates selection event docs for v12. |
| controls/data-display/structured-data/treedatagrid/index.md | Restructures overview/quickstart for v12 workflows; adds upgrade tip and updated install guidance. |
| controls/data-display/structured-data/treedatagrid/filtering.md | Clarifies filtering constraints and updates examples to fluent column setup. |
| controls/data-display/structured-data/treedatagrid/expand-and-collapse.md | Updates hierarchical expand/collapse examples to fluent APIs and new event arg usage. |
| controls/data-display/structured-data/treedatagrid/column-types.md | Rewrites column types page for new column types, XAML usage, and fluent code-behind APIs. |
| controls/data-display/structured-data/treedatagrid/breaking-changes-v12.md | Adds a v12 migration guide documenting breaking API changes. |
| controls-sidebar.ts | Adds the new breaking-changes page to the TreeDataGrid docs sidebar. |
Comments suppressed due to low confidence (1)
controls/data-display/structured-data/treedatagrid/index.md:113
- The sample data includes an extra trailing space in the
FirstNamestring literal ("Lailah "). This can lead to confusing output/sorting/filtering results in examples; remove the trailing space.
new Person { FirstName = "Jeremy", LastName = "Navarro", Age = 74 },
new Person { FirstName = "Lailah ", LastName = "Velazquez", Age = 16 },
new Person { FirstName = "Jazmine", LastName = "Schroeder", Age = 52 },
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
controls/data-display/structured-data/treedatagrid/breaking-changes-v12.md
Show resolved
Hide resolved
| | Property | Description | | ||
| | ---------------------- | --------------------------------------------------------------------------------------------- | | ||
| | `Source` | The data source that drives the control's rows and columns. | | ||
| | `ItemsSource` | Binds to a collection for XAML-defined columns. | | ||
| | `Source` | The data source that drives the control's rows and columns (code-behind approach). | | ||
| | `SelectionMode` | The selection mode, e.g. `Row`, `Cell`, `Row,Multiple`. Default is `Row` (single selection). | |
There was a problem hiding this comment.
This page introduces an ItemsSource property and a XAML-first workflow. However, the generated API reference currently in this repo for Avalonia version-12.0.0-preview2 documents TreeDataGrid as having Source/Columns but no ItemsSource (see api_versioned_docs/version-12.0.0-preview2/avalonia/controls/treedatagrid.mdx). To avoid readers hitting a mismatch between the conceptual docs and the API reference, consider version-gating these docs, adding a note about the required TreeDataGrid package build, or coordinating the API reference update.
There was a problem hiding this comment.
We'll need to update the API reference when the package is pushed.
| ## Interfaces replaced with abstract classes | ||
|
|
||
| The major interfaces in the TreeDataGrid API have been replaced with abstract classes: | ||
|
|
||
| | 11.x | 12.x | | ||
| |---|---| | ||
| | `ITreeDataGridSource` | `TreeDataGridSource` | | ||
| | `ITreeDataGridSource<TModel>` | `TreeDataGridSource<TModel>` | | ||
| | `IColumn` | `TreeDataGridColumn` | | ||
| | `IColumns` | `TreeDataGridColumns` | | ||
| | `IRows` | `TreeDataGridRows` | | ||
| | `ITreeDataGridSelection` | `TreeDataGridSelectionModel` | | ||
| | `ITreeDataGridRowSelectionModel<T>` | `TreeDataGridRowSelectionModel<T>` | | ||
| | `ITreeDataGridCellSelectionModel<T>` | `TreeDataGridCellSelectionModel<T>` | |
There was a problem hiding this comment.
This section states that key TreeDataGrid interfaces (e.g. ITreeDataGridSource, IColumn) were replaced with abstract classes. However, the generated API reference currently present in this repo for version-12.0.0-preview2 still documents these as interfaces (e.g. api_versioned_docs/version-12.0.0-preview2/avalonia/controls/itreedatagridsource.mdx and .../models/treedatagrid/icolumn.mdx). To avoid confusing readers, either update/coordinate the API reference, or clarify in this doc which TreeDataGrid package version/preview the change applies to (and whether the interfaces remain as obsolete shims).
There was a problem hiding this comment.
We'll need to update the API reference when the package is pushed.
controls/data-display/structured-data/treedatagrid/breaking-changes-v12.md
Show resolved
Hide resolved
luke-whos-here
left a comment
There was a problem hiding this comment.
Left a few comments and suggestions.
Overall, the new docs are clear, user-friendly and consistent when similar topics are addressed between different pages. Additional cross-links to relevant pages could be nice, but not strictly necessary.
controls/data-display/structured-data/treedatagrid/breaking-changes-v12.md
Outdated
Show resolved
Hide resolved
controls/data-display/structured-data/treedatagrid/breaking-changes-v12.md
Outdated
Show resolved
Hide resolved
controls/data-display/structured-data/treedatagrid/breaking-changes-v12.md
Outdated
Show resolved
Hide resolved
controls/data-display/structured-data/treedatagrid/breaking-changes-v12.md
Outdated
Show resolved
Hide resolved
controls/data-display/structured-data/treedatagrid/breaking-changes-v12.md
Outdated
Show resolved
Hide resolved
controls/data-display/structured-data/treedatagrid/column-types.md
Outdated
Show resolved
Hide resolved
controls/data-display/structured-data/treedatagrid/filtering.md
Outdated
Show resolved
Hide resolved
controls/data-display/structured-data/treedatagrid/selection-modes.md
Outdated
Show resolved
Hide resolved
luke-whos-here
left a comment
There was a problem hiding this comment.
Left a few comments and suggestions.
Overall, the new docs are clear, user-friendly and consistent when similar topics are addressed between different pages. Additional cross-links to relevant pages could be nice, but not strictly necessary.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Luke <55367595+luke-whos-here@users.noreply.github.com>
Swap table columns. Slight wording change to avoid specific mention of 12-preview, which has been superseded by 12-rc1.
Quite a lot has changed in TreeDataGrid 12, so the docs needed a fair bit of a rework.
From the release notes:
SelectionChangedEventArgsfor row and cell selection