We have a bit of code that tells us how many elements are in the visual tree of a window. To test the virtualization of our XamDataGrid implementations, I'll add enough data to a grid so that the scrollbar appears, check the number of visual elements, then vertically expand the grid so that more elements are visible. This works as expected.
What I've found, though, is that after enlarging the window, if I shrink it so that fewer records are displayed in the grid, the number of elements in the visual tree never goes down. It's as if the elements that were created by resizing the window are not destroyed. Does this have to do with having REcordContainerGenerationMode set to Recycle instead of Virtualize, and is this behavior expected?
Thanks.
Hello Dierk,
Thank you for your post. I have been looking into it and I can say that this behavior is expected and it is not related to the Mode you are using. The virtualization in the XamDataGrid works when you scroll the Records inside it, not when you resize the grid. Here you can find more information about the generation modes:
http://help.infragistics.com/Help/Doc/WPF/2011.2/CLR4.0/html/InfragisticsWPF4.v11.2~Infragistics.Windows.Controls.ItemContainerGenerationMode.html
Please let me know if you have further questions on this matter.
Looking forward for your reply.