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
Hi everybody,
today I downloaded IG 2012.2 (Version 12.2.20122.1006) and upgraded our project, but this issue is still there...
Regards,
Wolfgang
Hello Urs,
I created the following case for you: 'CAS-101749-K5X9R7' and will update you through it.
Hello Veljko,
I created the following case for you: 'CAS-101747-J6B7P6' and will update you through it.
Yes, as I explained in my second post, this is the exact same issue we had. Glad we don't have to test this to know it still doesn't work in newer versions... but, alas, this isn't a good workaround for us, since our data classes are generated by ORM, and I don't want to change those parts since it's already too complicated.
I've scarcely looked around with reflector in infragistics dlls but couldn't find the part where it digs inside the object type to get it's properties. My guess was that something in the reflection assembly changed in .net 4.5, but I've tried and by using classic reflection to get to property info's doesn't return any duplicates... so it's still an issue...
Hi
First excuse my mutliple posting. I always got an error from the website and thought my post was not saved.
In the meantime we found a workaraound which maybe points to the original problem:
We bound an UltraCombo to a "List<ICustomer>"
ICustomer derives from ISomethingElse and had properties which were marked "new" overriding properties from base interface.We just removed the 3 properties from ICustomer and this solved the problem.
public interface ICustomer: ISomethingElse { new int ValueMember { get; set;} new string DisplayMember { get; set;} new IListenObjekt Instanz { get; } ... }
public interface ISomethingElse { int ValueMember { get; set;} string DisplayMember { get; set;} IListenObjekt Instanz { get; } }
Probably Infragistics (or a .NET call) returns the proerpties from ICustomer AND ISomethingElse which then generated "Key already Exists".
Kind regardsUrs Scherrer