This article covers practical workflows for validating TreeDataGrid behavior in development and CI.
dotnet run --project samples/TreeDataGridDemo/TreeDataGridDemo.csproj
Use sample scenarios to validate:
dotnet restore Avalonia.Controls.TreeDataGrid.slnx
dotnet build Avalonia.Controls.TreeDataGrid.slnx -c Release --no-restore
dotnet test tests/Avalonia.Controls.TreeDataGrid.Tests/Avalonia.Controls.TreeDataGrid.Tests.csproj -c Release
./check-docs.sh
dotnet pack src/Avalonia.Controls.TreeDataGrid/Avalonia.Controls.TreeDataGrid.csproj -c Release -o artifacts/packages
Before publishing, verify:
Use lifecycle events to inspect realization/edit paths:
grid.CellPrepared += (_, e) => Console.WriteLine($"CellPrepared C={e.ColumnIndex}, R={e.RowIndex}");
grid.CellClearing += (_, e) => Console.WriteLine($"CellClearing C={e.ColumnIndex}, R={e.RowIndex}");
grid.RowPrepared += (_, e) => Console.WriteLine($"RowPrepared R={e.RowIndex}");
grid.RowClearing += (_, e) => Console.WriteLine($"RowClearing R={e.RowIndex}");
This helps detect over-realization, incorrect reuse, and unexpected re-entry.
Source swap, Items replacement)flaky selection tests Cause: asserting visuals instead of model indexes; prefer model-level assertions first.
drag/drop tests fail only in sorted mode Cause: sorted sources intentionally block automatic drag/drop move paths.
docs CI failures Cause: unresolved links or xrefs after API/article refactor.