I have several grids that are bound to large collections of objects that change frequently either from a background updater thread or by an edit in the xamgrid. For performance, and simplicity, I would like to use something like an ObservableDictionary<int, MyObject> to store the data where the key is a unique lookup value and the value is the object itself.
I can't figure out how to bind xamgrid to this type of data structure. Obviously, I can make an ObservableCollection<MyObject> off the dictionary Values but this is problematic in that to add update items you have to manually sync bptj the observablecollection and the dictionary.
Anyone else ever wanted to this.
Hello,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I created a class that Derives from Dictionary and INotifyCollectionChanged and implemented Add and Remove methods and added notification to the setters. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Well, that was simpler than I thought. I took your example and added a few things (implemented INotifyPropertyChanged on MyObject and added another button to test it). Works just like I wanted. Thanks so much!
Well, it appears that using the "Value.Property" as the key to your column still causes a crashing problem with grouping and filtering. I had reported this as a bug a while back (Issue #81412) and received an email that it was fixed in build 2045 but I just downloaded 2068 this morning and it has either been reintroduced or was never properly fixed (sorry for not testing earlier). To see what I'm talking about, open the attached and drag the "Age" column up into the group by area.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well. Also I will update you about the other issue through the CHS.
Thanks again.
Hi Stefan,
I tested it against 11.2.20112.2031 and can confirm that the grouping issue we were seeing in CAS-84326-PVWDJ0 has been fixed so I closed the ticket.
Any news on CAS-84644-XZF383 - that's the one that is going to hold us up if it doesn't get resolved?
Thanks!
We have shipped out a new service release where your issue is resolved. I'd be glad to find out if you had tested it out and if it had met your requirements.
You can download the Service Releases by logging to our web site and going to My IG \My Keys and Downloads.
I have logged this with development under ID: 101848 and I have also created a separate support ticket on your behalf: CAS-84644-XZF383 and have linked the development issue to it, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags: https://es.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://es.infragistics.com/Membership/MySupport.aspx
Thanks for filing the bug. Upon further inspection, I think I may have found another unrelated bug in the same basic sample (see attached). To recreate the bug, click "Remove" (which will remove the last row in the grid), then click "Add" (which will add it back), then click "Update" which will increment the Age value by one for all values in the collection. Note how in the xamgrid, Update doesn't update the new last item - but if you switch to the "DataGrid" tab and try the same procedure in plain old datagrid it works as expected (note that each grid if bound to its own collection rather than the same one for simplicity).