Hi,
We changed our grid to use RetainDeactivatedContainersPermanently a while back to improve reloading time. We change the datasource quite frequently so this setting makes sense. However, scrolling time seems to be affected for us. When users scroll the grid, it was not smooth and make them think it is slow. I did a profiling via dotTrace and saw the hotspot while scrolling was in OnContainerDiscarded (attached).
If you look in the call stack, you can see the stack has RemoveAllDiscardedContainer when Layout updated. This does not make sense as we already set to RetainDeactivatedContainersPermanently so we expect these containers to remain there forever.
Out of curiousity I set the grid to RetainDeactivatedContainers only and the scrolling was fast again. Of course we cannot use this as this make us have the problem with reloading grid again. The hot spot was gone. So it looks like RetainDeactivatedContainersPermanently is still destroying containers while scrolling different from RetainDeactivatedContainers. Is this a bug? Is it a mattter of handling scrolling for RetainDeactivatedContainersPermanently in the same manner as RetainDeactivatedContainers
Please advise.
Thank you.
Hello bachvudao,
I have been investigating into this behavior that you are referring to with the RecordContainerRetentionMode, but at the moment, I cannot seem to reproduce the behavior that you are referring to in which the containers are deactivated while scrolling. When running against the source code of the XamDataGrid, I only see the OnContainerDiscarded method hit when the DataSource is changed. In the case of the "RetainDeactivatedContainersPermanently" option, I don't believe this is correct either, but from your description this appears to be happening during scrolling, which is a bit more of a pressing issue at the moment.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 16.2.20162.2109 in Infragistics for WPF 2016 Volume 2.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
I managed to repro in your sample app with some changes. I attached a screenshot with the Record Discard call. The trick is to have nested data so in your code, I just added a List at the end of the sample data to contain the Order Data. I also attached the sln with this post. The difference seems to be to get the BaseDataPresenter to hook the OnLayoutUpdated event. That event seems to be hooked only when there is nested data.
Once you have the solution running, just open a few rows to see the nested data. Then scroll up and down a few times and take a profile, you should see the container discard method.
Hi Andrew,
Thank you for looking into this. I will try your sample project and get back to you. We are using 16.1.20161.1000.