You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a situation when there is a disabled item in the DataGrid. This item has the IsEnabled="False" property set. When such an item is at the very top (the first in the DataGrid) and when trying to move any other item above such an item, the program hangs. It seems that the program gets stuck in the BaseDataGridDropHandler.cs > FindDataGridRowFromChildView method in a loop.
Below I have provided an example to reproduce this behavior:
I tried to track where the cursor goes in the visual tree, it seems it goes beyond the DataGrid:
privatestaticDataGridRow?FindDataGridRowFromChildView(StyledElementsourceChild){intmaxDepth=16;DataGridRow?row=null;StyledElement?current=sourceChild;while(maxDepth-->0||rowisnull){if(currentisDataGridRowdgr)row=dgr;Debug.WriteLine($"Traversing to parent: {current.GetType().Name}");current=current?.Parent;}returnrow;}
Debug:
Traversing to parent: Rectangle
Traversing to parent: Grid
Traversing to parent: Border
Traversing to parent: Grid
Traversing to parent: DataGridRowHeader
Traversing to parent: DataGridFrozenGrid
Traversing to parent: Border
Traversing to parent: DataGridRow
Traversing to parent: DataGridRowsPresenter
Traversing to parent: Grid
Traversing to parent: Border
Traversing to parent: DataGrid
Traversing to parent: Grid
Traversing to parent: TabItem
Traversing to parent: TabControl
Traversing to parent: MainWindow
I found a workaround in the following: BaseDataGridDropHandler.cs
There is a situation when there is a disabled item in the DataGrid. This item has the
IsEnabled="False"
property set. When such an item is at the very top (the first in the DataGrid) and when trying to move any other item above such an item, the program hangs. It seems that the program gets stuck in theBaseDataGridDropHandler.cs
>FindDataGridRowFromChildView
method in a loop.Below I have provided an example to reproduce this behavior:
The text was updated successfully, but these errors were encountered: