Are there options for controlling the data binding of IgbDataGrid? From what i can tell, it simply traverses the entire type of the given object finding all public properties. This runs into problems when objects have complex structures with circular references... a StackOverflowException occurs.
So i would like to be able to control this behavior and limit the properties that the grid can bind to. In the past (with Windows Forms) we used an object that implemented System.ComponentModel.ITypedList to be able to control the binding in complex cases. For example, to limit binding to properties of a single interface.
Note, I am trialing this product in an attempt to reuse as much code as possible from an existing solution, so am curious is this possible? The alternative i see is to create new view models that do not have the same circular references.
Hello Tony,
I added your your sample to a bug report we have in your systems.
I have created a private support case for you. It has an ID of C-00224106, and you can access it after signing into your account on the Infragistics website, here: account.infragistics.com/support-cases.
Hi Michael,
It doesn't look like Tim has replied with a sample, so I've attached one.
It's a trivial example, in that you would not normally set up a circular reference between "employee" and "manager" this way. But I wanted to keep it as close to the original demo code as possible.
On a side note, I would have thought the "DataSourceDesiredProperties" would facilitate selection of properties from the source model somehow ... but I wasn't able to get it to work.
Class IgbDataGrid (infragistics.com)
TCircularReferenceComplexObject.zip
Hello Tim,
Just a quick follow up, our development team reported we don't support any data binding options to ignore or accommodate the circular reference. At this time it's considered a new product idea. I still suggest providing a sample so we can work on preventing any unwanted exceptions.
Let me know if you have any further questions.
Thank you for contacting Infragistics. Is the grid throwing the exception in console but working normally? Or is the exception blocking the UI?
Have you tried manually generating your columns and applying AutoGenerateColumns to false to see if that at least suppresses behavior?
eg.www.infragistics.com/.../data-grid-local-data
I've passed over your details to our developers to get a better understanding what is or isn't supported. However it's important if you can provide a sample application demonstrating the issue. At the very least we should be preventing the exception and not cause any noticeable unwanted behavior.
Let me know if you have any questions.