WPF DataGrid.ItemsSource in DataGrid inside another DataGrid's RowDetails XAML causing Visual Studio 2019 to crash and exit

Mike Whalley 71 Reputation points
2020-04-10T09:14:52.137+00:00

That might sound a bit complicated, but I have a datagrid inside the rowdetails of another datagrid in a WPF window. I recently installed version 16.5.3 of VS2019. The WPF window builds and executes successfully, but if I try to edit the .xaml file, the VS2019 Designer fails to load the file and VS2019 closes down without any error message. The same thing does not happen using VS2017, and I have been using, and editing, this XAML code previously for some time.

I have managed to isolate the problem to the following assignment of the rowdetails' datagrid's ItemsSource - this is what is causing VS2019 to crash:

<DataGrid.ItemsSource>
    <MultiBinding Converter="{StaticResource ValueConverterGetLast30Days}">
         <Binding Path="Transactions"/>
         <Binding  Path="BankAccountID"/>
     </MultiBinding>
</DataGrid.ItemsSource>  

As you can see, it calls a ValueConverter which creates a list of the items to be inserted into the rowdetails datagrid.

I have managed to work around the problem by creating the datagrid's ItemsSource in code and then adding the data to the datagrid on the LoadingRowDetails event being triggered.

But I am mystified as to why trying to load a WPF window containing this XAML code snippet into the VS2019 Designer (I get the same crash with Blend, incidentally) should cause VS2019 to crash, but not in VS2017 and also while still allowing the Solution to build and execute as expected, and thought I should publicise the problem.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,670 questions
{count} votes

Accepted answer
  1. Brandon S 76 Reputation points
    2020-04-20T14:52:23.527+00:00

    The crash is due to an error in the last few updates for VS2019. VS2019 will crash when opening up the designer where <Binding/> has been implemented.

    Microsoft is aware of the issue and has stated at they are working on it but it is taking a tad longer than I would have anticipated. Especially per the fact that you cannot code in XAML at all while the issue still exists in VS2019.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Mike Whalley 71 Reputation points
    2020-05-17T20:07:19.377+00:00

    Thank you, but this is very frustrating. There doesn't appear to be any way in VS to open just the XAML code without the designer window as well, other than just using a text editor, which is not ideal.
    Can I be informed when there is some progress made by Microsoft in correcting this bug?
    Many thanks.

    1 person found this answer helpful.
    0 comments No comments