System.ArgumentOutOfRangeException when using DataPager
I tried to add the new DataPager
DataPager.Source = _dataList;
DataPager.PageSize = pageSize;
dataGrid.ItemsSource = DataPager.PagedSource;
but after assigning the PageSource, the app crashes when I continue in debugger. Debugger now stops inside syncfusion code at SfViewHandler.cs in public new void Add(IView child):
VS2022 17.8, .net 7 MAUI app, Target is Windows part of the app net7.0-windows10.0.19041.0, SfDataGrid 24.1.47
When I click on continue debugger stops in
protected override Size MeasureContent(double widthConstraint, double heightConstraint)
This is the callstack:
System.Private.CoreLib.dll!System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() Line 53
at /_/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs(53)
WinRT.Runtime.dll!WinRT.ExceptionHelpers.ThrowExceptionForHR.__Throw|39_0(int hr)
Microsoft.Maui.dll!Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(Microsoft.Maui.IViewHandler viewHandler, double widthConstraint, double heightConstraint)
Microsoft.Maui.dll!Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(Microsoft.Maui.IView view, double widthConstraint, double heightConstraint)
Microsoft.Maui.Controls.dll!Microsoft.Maui.Controls.ScrollView.MeasureOverride(double widthConstraint, double heightConstraint)
Microsoft.Maui.Controls.dll!Microsoft.Maui.Controls.Compatibility.Layout.Microsoft.Maui.IView.Measure(double widthConstraint, double heightConstraint)
Syncfusion.Maui.DataGrid.dll!Syncfusion.Maui.DataGrid.SfDataGrid.MeasureContent(double widthConstraint, double heightConstraint) Line 3401
at Syncfusion.Maui.DataGrid\SfDataGrid.cs(3401)
Syncfusion.Maui.Core.dll!Syncfusion.Maui.Core.SfView.Microsoft.Maui.ILayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint) Line 228
at Syncfusion.Maui.Core\SfView.cs(228)
Syncfusion.Maui.Core.dll!Syncfusion.Maui.Core.Platform.LayoutPanelExt.MeasureOverride(Windows.Foundation.Size availableSize) Line 150
at Syncfusion.Maui.Core.Platform\LayoutPanelExt.cs(150)
Here are the locals:
Here I can't continue, next the VS shows a dialog to open new instance of VS as debugger.
Now I'm lost and can't continue.
Hi Andre Ziegler,
We would like to inform you that we are aware of a known issue on our end
related to this error. However, this issue is observed only under specific
conditions during runtime actions. Could you please clarify whether you are
encountering this problem during the initial loading or while performing
specific actions at runtime?
Also, we have tested the basic SfDataGrid with SfDataPager on our end, and we didn't face any issues during the initial loading. We have attached that sample for your reference.
To facilitate a more thorough investigation, we kindly request you to modify the attached sample to replicate the issue you are experiencing. Furthermore, please provide any necessary steps to reproduce the issue effectively. Your cooperation in this matter is greatly appreciated.
Note: We have conducted tests using the latest DataGrid version 24.1.47 and .NET 8 on the Windows platform.
Regards,
Tamilarasan
Attachment: Sample_b1083fb6.zip
Hallo and thanks for your reply.
yes I do this on runtime as I avoid all automatic bindings and assign it on my own. In your demo you use predefined columns and I let them generate automaticlly and depending on input I hide some columns like IDs.
I compute the pagesize in OnSizeAllocated and now also do a check that pageSize is not 0 as adviced in the docs.
Andre Ziegler,
Thank you for the update. We acknowledge that this issue is a known issue on
our end, and it has already been addressed. The fix is set to be included in
the upcoming 2023 Volume 4 Service Pack release, scheduled for rollout on
January 31, 2024. We assure you that we will notify you promptly once the
release is published. We sincerely appreciate your patience and understanding
during this time.
Regards,
Tamilarasan
Andre Ziegler,
We are glad to announce that our Essential Studio 2023 Volume 4 SP Release V24.2.3 is rolled out and is available for download under the following link.
Furthermore, we are pleased to inform you that the issue related to your use case has been successfully addressed. The fix has been included in our 2023 Volume 4 Service Pack (SP) release. We trust that this fix will resolve the issue you have encountered. Please update the DataGrid package to version 24.2.3.
https://www.nuget.org/packages/Syncfusion.Maui.DataGrid
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.
Regards,
Tamilarasan
I can confirm that the version 24.2.3 fixed my issue and I can see the Pager now.
Thank you very much for the help.
- 6 Replies
- 2 Participants
- Marked answer
-
AZ André Ziegler
- Jan 24, 2024 01:23 PM UTC
- Feb 2, 2024 08:04 AM UTC