WPF UI DataGrid Exception
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Sorting the data grid several times in quick succession will cause an exception: "System.InvalidOperationException: ''ContentControl' TargetType does not match type of element 'DataGridColumnFloatingHeader'.'" The issue isn't reproducible every time, but does happen consistently. A stack trace from the exception is attached.
WPF UI DataGrid Exception Stack Trace.txt
To Reproduce
Run Wpf.Ui.Demo and switch to the Data page.
Scroll to the WPF UI DataGrid.
Click the headers quickly, the exception happens pretty reliably for me within about 15 seconds.
Expected behavior
I'd expect the control to be able to be sorted quickly without raising an exception that crashes the program.
Screenshots
No response
OS version
Windows 11 Enterprise 22H2, 22621.1105
.NET version
.NET 7.0
WPF-UI NuGet version
2.0.3
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run Wpf.Ui.Demo, open the Data page, find the WPF UI DataGrid, and reproduce the failure by clicking headers quickly. Read the attached WPF UI DataGrid Exception Stack Trace.txt to identify the relevant control path. Done means rapid sorting no longer raises the reported InvalidOperationException or crashes the program.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100