microsoft / XamlBehaviorsWpf

Home for WPF XAML Behaviors on GitHub.
MIT License
852 stars 140 forks source link

Expanding a Datagrid column after a total row deletion crashs the Datagrid #148

Closed O4D closed 10 months ago

O4D commented 10 months ago

Describe the bug A. After a total deletion of all the rows present in Datagrid, the column resizing crash on visual.cs

Complementary/Very similars bugs : B. After 50 element added then all deleted, it crash on visual.cs C. (Same project) A scrollviewer Visible without any row in the Datagrid trigger a crash on visual.cs

To Reproduce A. Steps to reproduce the behavior:

  1. Click on 'Add 10'
  2. Click on 'Erase All'
  3. Resize the column width with mouse
  4. See error "The specified Visual is not an ancestor of this Visual"

B. Steps to reproduce the behavior:

  1. Click on 'ADD 10' (5 times, so 50elements)
  2. Click on 'Erase All'
  3. See error "The specified Visual is not an ancestor of this Visual"

C. Steps to reproduce the behavior:

  1. In XAML, set the Scrollviewer visibility to "Visible"
  2. Launch the project
  3. See error "The specified Visual is not an ancestor of this Visual"

Expected behavior Not a crash

Screenshots

Desktop (please complete the following information):

Reproduction Link DataGrid_VisualCrash SIMPLE.zip

Additionnals comments : This issue is reported because of a more problematic issue which is happening on datagrid on a more complex C# Solution : when the datagrid is displayed, after 2 total erasment of the row, the same crash appears. So I'm trying to isolate any crash source.

brianlagunas commented 10 months ago

I believe you have posted this issue in the wrong repo. This is the WPF Behaviors repo, not the data grid repo. Please post this issue in the appropriate github repo.