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,
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.
Hello bachvudao,
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://es.infragistics.com/my-account/support-activity.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Not sure how to attach multiple files so I made this reply to show the screenshot of the profile.
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.