Skip to content

Update docs for TreeDataGrid 12.#924

Merged
luke-whos-here merged 10 commits intomainfrom
tdg-v12
Mar 27, 2026
Merged

Update docs for TreeDataGrid 12.#924
luke-whos-here merged 10 commits intomainfrom
tdg-v12

Conversation

@grokys
Copy link
Copy Markdown
Member

@grokys grokys commented Mar 20, 2026

Quite a lot has changed in TreeDataGrid 12, so the docs needed a fair bit of a rework.

From the release notes:

  • Define TreeDataGrid columns from XAML
  • Major refactoring of API - see breaking changes doc
  • Fluent columns API
  • Unified SelectionChangedEventArgs for row and cell selection
  • Experimental bindings removed - TreeDataGrid now uses standard Avalonia bindings

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FirstName string 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.

Comment on lines 69 to +73
| 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). |
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to update the API reference when the package is pushed.

Comment on lines +206 to +219
## 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>` |
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to update the API reference when the package is pushed.

Copy link
Copy Markdown
Contributor

@luke-whos-here luke-whos-here left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@luke-whos-here luke-whos-here left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

luke-whos-here and others added 3 commits March 27, 2026 20:36
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.
@luke-whos-here luke-whos-here merged commit 6ebb5f2 into main Mar 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants