After installing .NET 4.5, our existing code that currently runs on .NET 4.0 is throwing exceptions when assigning data source to DataGridView (note that it was working fine before .NET 4.5, and continues to work when 4.5 is uninstalled... but for several reasons we have to have .NET 4.5 on clients computers):
dgrManagers.DataSource = mManagers;
//where mManagers is System.Collections.ObjectModel.ObservableCollection<IManager>; the collection has 0 items.
//and dgrManagers is an instance of class that extends from Infragistics UltraGrid (Infragistics.Win.UltraWinGrid.v5.2.dll, v5.2.20052.1053).
//Extending is for style purposes, no grid content is referenced.
Previous to this, the grid was initialized (once) with:
foreach (UltraGridColumn c in dgrManagers.DisplayLayout.Bands[0].Columns) { switch (c.Key) { case "FullName": c.Header.Caption = "Full name"; c.Header.VisiblePosition = 0; c.Width = dgrManagers.Width - 30; break; default: c.Hidden = true; break; } } dgrManagers.HasLayout = true;
Errors specifics:
HResult: -2147024809
Assemlby: {Infragistics.Shared.v5.2, Version=5.2.20052.1053, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb}
Key already exists Parameter name: Key
at Infragistics.Shared.KeyedSubObjectsCollectionBase.ValidateKeyDoesNotExist(String key, IKeyedSubObject ignoreObject) at Infragistics.Shared.KeyedSubObjectsCollectionBase.ValidateKey(String key, IKeyedSubObject ignoreObject) at Infragistics.Shared.KeyedSubObjectsCollectionBase.ValidateKey(String key) at Infragistics.Shared.KeyedSubObjectsCollectionBase.InternalAdd(IKeyedSubObject obj) at Infragistics.Win.UltraWinGrid.ColumnsCollection.InternalAdd(UltraGridColumn column) at Infragistics.Win.UltraWinGrid.UltraGridBand.InitColumns(UltraGridBand[] oldBands) at Infragistics.Win.UltraWinGrid.UltraGridBand.InitListManager(BindingManagerBase bindingManager, String dataMember, UltraGridBand[] oldBands) at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated(BindingManagerBase bindingManager) at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated() at Infragistics.Win.UltraWinGrid.UltraGridBase.Set_ListManager(Object newDataSource, String newDataMember) at Infragistics.Win.UltraWinGrid.UltraGridBase.set_DataSource(Object value)
I understand this is an old version of Infragistics, but we're not ready to switch to new one (even though we have some newer licences) since the project is quite huge and has been working for quite some time, and I'm afraid it would cause even more errors if the new version is not fully backward compatible.
Does anyone have any idea how to circumvent this problem? Any help/hint is appreciated...
Thanks,
Veljko
It's a bit complicated to experiment with this since I first have to install .NET 4.5, break our base classes that inherit the Infragistics, compile everything back and test every app that's using our base dll's ... I'll let you know if I manage to handle this, but so far, I'll mark this as answered since there's no further info that can help...
Thanks for your replies!
Hello Veljko,
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
Hi Veljko,
I'm not absolutely sure, but my guess is no, I don't think it will work with 8.2. You could try it out and see, of course - I could be wrong.
But since CLR4 was released with Visual Studio 2010, I'm thinking that 2008 is probably too early. On the other hand, my memory is not perfect, and it's possible that the changes I am thinking of occurred for CLR3, so maybe they were made earlier than I think.
The only way to know for sure would be to try it out.
So, basically, if this is to work, either we change inheritance tree of all objects in use, or change the version of NetAdvantage...
Since changing the version seems like a lot less effort, can you estimate if the NetAdvantage 8.2 would work with this scenario? I believe this is the latest version we bought our license for...
Hi,
You are probably right. Microsoft made some changes in CLR4 and we had to change around certain interfaces we were using in the WinGrid and some other assemblies that deal with data binding.
These issues are fixed in the latest version of NetAdvantage.
NetAdvantage 2005 is, of course, not supported in DotNet CLR4, since that version of NetAdvantage was retired years before CLR4 was release.