i have just upgraded my computer to a Sony all in one PC and i have installed all the software i use,, but when it comes to running my application which uses infragistics controls via deployment and via Debugging environment the app crashes as soon as it has to load data into a XamDataGrid with the following error:
Argument Exception was unhandled
Item has already been added. Key in dictionary: 'Infragistics.Windows.Automation.Peers.DataPresenter.CellAutomationPeer' Key being added: 'Infragistics.Windows.Automation.Peers.DataPresenter.CellAutomationPeer'
I have tried tracking down the error but to no avail so any assistance will be greatly appreciated.
The Computer is running Windows 7 Professional 64bit and im using NetAdvantage WPF 2010.3
pramanju said: Andrew, just to let you know that the issue is seen when Google Desktop process is running. When I kill Google Desktop process, the issue is resolved. I was able to reproduce this consistently when Google desktop running.
Andrew, just to let you know that the issue is seen when Google Desktop process is running. When I kill Google Desktop process, the issue is resolved. I was able to reproduce this consistently when Google desktop running.
Then that must be an automation or accessibility client. Unfortunately it doesn't really mean much as lots of things are automation clients - testing tools, recording tools, narrator, magnifier, etc.
pramanju said:And the work around you provided for window is not working for me. Our customers are reporting same issue and it seems they are not running any other processes. Just wanted to check if you get any clue out of this information
In the quick test I performed the automation peers were not created when the window (or some element ancestor to the grid) did not return the grid's peer as its automation peer. I can't really say why the workaround didn't work for you. Maybe your app allows floating the grid (or the grid is displayed in some other window for which you didn't implement the workaround) and an ancestor of the grid (between it and the window) in that case didn't have an automation peer that would have excluded the grid's peer. Or perhaps there was some other code path that did cause the automation peers to be created that I didn't encounter in my test.
Andrew, can you send me the source code location for Infragistics 9.1 version? We would like to try the fix you have suggested. Lot of our customers are reporting this issue so we are planning to provide the fix without upgradation.
And the work around you provided for window is not working for me. Our customers are reporting same issue and it seems they are not running any other processes. Just wanted to check if you get any clue out of this information
Thanks Andrew !!. Will try this work around and see if it works for us.
I'm sorry but there really is no information I can provide other than what I have. If you cannot upgrade and you have access to the source then you can make the change that I mentioned and use your own build of the assemblies.
The only other thing that I can think of is if you can live without automation support then you could override the OnCreateAutomationPeer in your window class or something above the xamDataGrid and return a derived automation peer of the peer class that element would use and override it's GetChildrenCore and return no children. This would of course mean that the grid would be invisible to any automation/accessibility client which could include your recording app, test platforms, etc. If you want to go this route then it might look something like:
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer() { return new CustomWindowAutomationPeer(this); } } public class CustomWindowAutomationPeer : System.Windows.Automation.Peers.WindowAutomationPeer { public CustomWindowAutomationPeer(Window owner) : base(owner) { } protected override List<System.Windows.Automation.Peers.AutomationPeer> GetChildrenCore() { return new List<System.Windows.Automation.Peers.AutomationPeer>(); } }
protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer() { return new CustomWindowAutomationPeer(this); } }
public class CustomWindowAutomationPeer : System.Windows.Automation.Peers.WindowAutomationPeer { public CustomWindowAutomationPeer(Window owner) : base(owner) { }
protected override List<System.Windows.Automation.Peers.AutomationPeer> GetChildrenCore() { return new List<System.Windows.Automation.Peers.AutomationPeer>(); } }