lepoco / lepoco/wpfui

WPF UI DataGrid Exception

Open
#498 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.