TabControl bug with sorted DataGrid
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
* .NET Core Version: 3.1
* Windows version: Windows 10.0.17763
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
I think the TabControl has a bug-like behavior with sorted DataGrids.
If you have a TabControl using a DataTemplate that has DataGrids in it, and you sort a DataGrid column and try to edit a cell in that column, and then try to change tabs in the TabControl, the program crashes with a framework exception that seems impossible to catch beforehand.
I don't believe that this is a desired behavior. The DataGrid should just stop the sorting when tabs are changed, I think the easiest solution is to just remove the throw in the source code.
I have created a minimal repro here:
https://github.com/Markz878/TabDataGridError
If anyone knows of another solution to this problem, please let me know.
Contributor guide
Assessment
This issue has not been assessed yet.