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.
Not sure how to attach multiple files so I made this reply to show the screenshot of the profile.
I have reproduced this behavior that you are referring to with the sample project you have provided. This appears to be a bug in the XamDataGrid, as the setting of the RecordContainerRetentionMode to "RetainDeactivatedContainersPermanently" should not discard the record containers while scrolling. As such, I have asked our engineering staff to examine this further, and have logged development issue 235909 to ensure this receives attention.
I have also created private support case CAS-183156-G5V5C2 for you, which I will link to this issue so that you can be notified when a fix or other resolution becomes available. You can access this support case by signing into your account on the Infragistics website and visiting: https://ko.infragistics.com/my-account/support-activity.
Hello,
We have found another related issue where even if we set RecordContainerRetentionMode=RetainDeactivatedContainersPermanently, the highlighted code (default case) in DataPresenterBase.UpdateLayout() calls RemoveAllDeactivatedContainers() which is costly. This happens in our usecase when we have nested rows.
switch (this._cachedRecordContainerRetentionMode)
{
case RecordContainerRetentionMode.RetainDeactivatedContainersUntilResize:
ViewBase currentViewInternal = this.CurrentViewInternal;
if (currentViewInternal.HasLogicalOrientation)
double num = currentViewInternal.LogicalOrientation == Orientation.Vertical ? this.ActualHeight : this.ActualHeight;
if (num < this._lastScrollDimensionExtent)
flag = true;
this._lastScrollDimensionExtent = num;
goto case RecordContainerRetentionMode.RetainDeactivatedContainers;
}
else goto case RecordContainerRetentionMode.RetainDeactivatedContainers;
case RecordContainerRetentionMode.RetainDeactivatedContainers:
if (flag)
currentPanel.RemoveAllDeactivatedContainers();
break;
default:
goto case RecordContainerReterntionMode.RetainDeactivatedContainers
Can you please confirm if this will be fixed with CAS-183156-G5V5C2 ? Seems like a case statement for RecordContainerRetentionMode.RetainDeactivateContainersPermanently is missing.