I have a XamDataGrid field layout with two IEnumerable fields within it. with in the get accessor of both the enumerable fields, I make a external call to populate the data for each and return back.
The behavior for this setup used to be like this: the parent row shows a expander, and when expanded the get accessor gets called and retrieves the rows to show for both the enumerable fields.
We have this setup from long time and is working fine as above. But recently, for some users the get accessor is getting called before even expanding, which is not the case for me when I debug locally. So, the same code is behaving differently for different users. When I compared the dlls that are loaded in mine with theirs, I see these two additional in mine: PresentationFramework-SystemCore.dll, System.ComponentModel.DataAnnotations.dll
Do they have anything to do with this behavior?
Why do I see different behavior for different users?
Also, theoretically I expected get accessor of enumberable to be called when loading parent field layout without expanding, but that was not the case how its happening (is it some optimization in infragistics?)
Our parent field layout itself is an enumerable list of model items, so as the external calls are happening for all the rows at once, UI crashes due to OOM. This was never the case before.
Any alternative approaches that I can take so that I can trigger the external call only when expanded, and prevent the list being populated all beforehand?
Application is using Infragistics 16.1 and is targeted towards .net framework 4.0. However, .4.6.1 is installed on the users' machines. I suppose there is backwards compatibility, so this shouldn't be a issue, right?
Thank you for your post. I have been looking into it and I can say that get accessor of the child collection is called when the record is expanded due to performance optimizations. As for the dlls you mention (PresentationFramework-SystemCore.dll, System.ComponentModel.DataAnnotations.dll) I don't think they are the reason for the different behavior. If you can send as an isolated sample where the behavior is reproducible we will be able assist you with this further.
Looking forward for your reply.
Sincerely, Stefan, MCPD Software Developer Infragistics, Inc. www.infragistics.com/support
Thanks for the reply Stefan.
As its happening for some set of users, I am still trying to create a reproducible example.
Meanwhile, can you let me know alternate approaches to resolve the issue. Can I listen on expanded event on the child enumerable object within field layout and then populate the collection?
I can suggest you capture the stacktrace from the getter, so we could be able to see what is calling it. You can log the Environment.StackTrace and send us the log from your customers machines.