Hi,
I do not have a sample ready, but when i enable conditional formatting via code behind and add new new rows to the underlying collection, the grid throws exception "Key already exists"
Below is the stack trace for your reference. I am using 12.2.20122.2204, the same issue occurs with previous releases as well.
at Infragistics.Collections.WeakDictionary`2.AddHelper(TKey key, TValue value, Boolean replace) at Infragistics.Controls.Grids.RowsManager.AttachDetachPropertyChanged(INotifyPropertyChanged propertyChangedDataObject, Boolean attach) at Infragistics.Controls.Grids.RowsManager.DataManager_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at Infragistics.DataManagerBase.OnDataSourceCollectionChanged(NotifyCollectionChangedEventArgs e) at Infragistics.DataManager`1.OnDataSourceCollectionChanged(NotifyCollectionChangedEventArgs e) at Infragistics.DataManagerBase.
b__3(DataManagerBase instance, Object s, NotifyCollectionChangedEventArgs e) at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex) at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at
e catchHandler)
<Add Data Here>
By the way, this is when using XamGrid
Hello Rohit,
I have been looking through your post and created a sample project (XamGridConditionalFormatting.zip). After the gri is loaded AllowConditionalFormatting property is set to true. And a rule is applied to the first column. The user can add new items to the source collection by pressing AddRecord button. It seems that no exception is thrown on my side. Would you please have a look at the attached project and let me know if I am missing something in your scenario? Could you modify the project so that it reproduces the issue or attached your sample project? Thank you in advance.
Thank you for your feedback. I am happy that it is working fine.
As Matt explained in the other forum thread, we expect a fix to be available in the next service release.
I found this was related to because xamgrid does not play nice with observablecollection (the issue occurs when multiple xamgrid uses the same underlying observable collectionview/collection-view-source)
http://es.infragistics.com/community/forums/p/83161/416008.aspx#416008
Once i removed such references it worked fine. As per above this is a bug in xamgrid.
Rohit,
I am just checking your progress on the issue. Does it occur in version 13.1?
You are right that such changes are made in version 13.1 and lots of the code is being rewritten. These changes are included in version 13.1 and they are not part of the new Service Release for 12.2. It seems that this behavior had not been reported before and the changes are not provided as a fix for a customer’s issue.
Would you mind let me know how do you change the source collection? Do you use the Add Row functionality or source collection is changed directly? Since currently no sample project could be provided, I could suggest you to test if the issue would appear if 13.1 version is used.
I am looking forward for your response.
OK I tried creating the similar scenario but somehow i could not reproduce the issue. In my enterprise app i am using Rx, caliburn micro, prism etc, so there is lot going on and i cannot easily reproduce it verbatim.
I finally gave up and decompiled the dll and looked at the error source. I see that in infragistics library 12.2.2204 the exception comes from the grid rowmanager, where it tries to add a property to a weakdictionary and on adding the same it throws an exception "key already exists" (See the stack trace in the first thread), if i decompile the newer version of the library 13.1.20131.1009, i see the rowmanagerbase now uses weaklist instead, so theoretically this bug is fixed by using the 13.1 release.
Could you please help verify with the developement team why this change was made (did we move to list from dictionary for similary exception reason or more?). Lastly does the new service release 12.2.2204 would include this change? We are going to go live with this release and much appreciate if you could help confirm?
Best Regards
Rohit