From d6850e3681a6521a58a6fa214185081d918e4303 Mon Sep 17 00:00:00 2001 From: k-hara Date: Tue, 17 Feb 2026 23:22:51 +0900 Subject: [PATCH] Remove support for case where the DataRow is descendant of a Grid or DataTable The removed logic would have been useless or more harmful, because of the reasons: 1) DataTable control is designed to represent 'header' of a table, not for containing the list of DataRows. 2) Grid control is often used to lay out other controls rather than constructing a table, so there was possibilities that completely unrelated Grids would have been caught as a parent. --- components/DataTable/src/DataTable/DataRow.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/DataTable/src/DataTable/DataRow.cs b/components/DataTable/src/DataTable/DataRow.cs index 6546150ae..a5be9c660 100644 --- a/components/DataTable/src/DataTable/DataRow.cs +++ b/components/DataTable/src/DataTable/DataRow.cs @@ -57,9 +57,6 @@ private void DataRow_Unloaded(object sender, RoutedEventArgs e) _isTreeView = itemsPresenter.FindAscendant() is TreeView; } - // 1b. If we can't find the ItemsPresenter, then we reach up outside to find the next thing we could use as a parent - panel ??= this.FindAscendant(static (element) => element is Grid or DataTable); - // Cache actual datatable reference if (panel is DataTable table) {