WPF Recursive call to Automation Peer API is not valid

后端 未结 8 822
孤独总比滥情好
孤独总比滥情好 2020-12-06 15:56

I am receiving an error message \"Recursive call to Automation Peer API is not valid\" when loading a datagrid with a datatemplatecolumn containing a combobox column. The er

相关标签:
8条回答
  • 2020-12-06 16:46

    I'm getting the same problem - are you using the datagrid from the WPFToolkit, or the one that ships with .NET 4.0. We're still using the toolkit one here.

    Also, I've notice that this problem does not occur when using the app through remote desktop.

    Similar problem posted here:

    http://wpf.codeplex.com/workitem/14443

    With a proposed solution. Haven't had a chance to try it.

    0 讨论(0)
  • 2020-12-06 16:52

    I had this same problem crop up on an older solution (although it was working fine on my local dev computer, but failing on the test system (with WPFToolkit 3.5.50211.1)

    Turned out my local dev computer had an older WPFToolkit: 3.5.40128.1

    However I did a little more checking around and realised that the problem was only when the DataGrid was a Microsoft.Windows.Controls.DataGrid (ie a WPFToolkit one), and it contained a control from the System.Windows.Controls namespace (in this case a ComboBox) - and from the .Net PresentationFramework.dll )

    We'd updated the solution to .Net 4.7.1 from .Net 4.5.1 -> which would have meant a new version of the PresentationFramework.dll, but the WPFToolkit dll had not changed.

    Decided that the best way to fix this was to just remove the WPFToolkit.dll reference, and update all the DataGrids from Microsoft.Windows.Controls.DataGrid to the newer System.Windows.Controls.Datagrid.

    0 讨论(0)
提交回复
热议问题