BUG Fatal Exception on .NET8 GA SfDataGrid (and Other) iOS Controls

Hi,

Environment : .NET 8 MAUI GA (8.0.3) with Syncfusion 23.2.4 Release.
Platform : iOS

There appears to be a unhandled fatal exception being thrown by the SfDataGrid & Other Syncfusion Controls (like SfListView) - which crashes our MAUI .NET8 GA iOS Application. I was able to catch the Exception in the iOS Program.cs (UIApplication.Main()) and it appears to be the Syncfusion.Maui.GridCommon classes/namespace causing it.

Exception Message : "Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')"
StackTrace :
" at System.Collections.Generic.List`1[[Syncfusion.Maui.GridCommon.ScrollAxis.RangeValuePair`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Syncfusion.Maui.GridCommon, Version=23.2.4.0, Culture=…"

Note : This is not happening on Android .NET8 GA (and was not happening on either platform with .NET7 MAUI) - it's specific to iOS / .NET8 version of Syncfusion.

From further investigation specifically with SfDataGrid - this exception was appearing a lot more when either of these things are used in SfDataGrid :

  1. The AlternateRowBackground property is set.
  2. A custom BackgroundColorConverter is used targeting the DataGridRow target type (this was implemented as per Syncfusion Documentation).

If I disable using either of these features then the crash does not happen 'as often' but am still seeing same exceptions being thrown less frequently (so it's not just these causes) & on other controls like the SfListView.  But these above items might be another SfDataGrid issue as well(?)

I suspect this is also happening in conjunction with the MVVM bound data source not being initialized yet too (not 100% sure but it happens before data is loaded & the error message indicates it's trying to work with an empty collection) - however note we have IsVisible set to false for both the SfDataGrid and parent controls (ie. Grid) at this point.

Expected Result :
The App/Page should never crash as a result of the SfDataGrid or other Syncfusion controls not being initialized or use of properties (particularly if data is still being loaded) - this needs to gracefully handled internally to all Syncfusion controls. As per above this was not an issue under .NET7 MAUI for either Platform and it's not an issue on Android .NET8 GA.

Thanks in advance for fixing this up!

Niall


5 Replies

TP Tamilarasan Paranthaman Syncfusion Team November 22, 2023 02:31 PM UTC

Hi Niall,


Based on the provided details, we have developed a sample showcasing the use of AlternateRowBackground and a custom BackgroundColorConverter targeting the DataGridRow. Upon testing, we didn't encounter the reported issue. We've attached this sample for your reference.


For a more thorough investigation, we kindly request that you share the specific sample where you've encountered the issue. Alternatively, if possible, you can modify the provided sample to accurately replicate the problem. These proactive steps will greatly aid us in conducting a comprehensive examination and providing a prompt solution.

Regards,

Tamilarasan


Attachment: Sample_b0b53139.zip


NI Niall replied to Tamilarasan Paranthaman November 22, 2023 08:21 PM UTC

Hi Tamilarsan,


Thanks for the sample, however as per my post above we are also seeing regular errors with other Syncfusion controls that have some sort of scrolling mechanism (like SfListView). As mentioned the SfDataFrid was also still throwing these errors without any alternate row styling (once I removed usage of all these properties).

In all cases our App does not directly call any methods on Syncfusion controls - it's all via Databinding. Hence, the exceptions reported above seem to definitely be caused by unhandled exceptions inside the Syncfusion controls & the exception we keep seeing is on ' Syncfusion.Maui.GridCommon.ScrollAxis.RangeValuePair'. 

I will try and get a more easily reproducible sample together (although please understand it's a *lot* of extra work for us), however would urge your developers to urgently please have a look at ensuring the above classes are not throwing uncaught exceptions at any point in the iOS/.NET8 release as this would still be the underlying cause and will ultimately end up being what needs to be fixed.

Right now it's made our MAUI App pretty much unusable, we have Syncfusion controls used all over it and we can't go more than a few pages or interactions without this exception randomly appearing and crashing the App. This definitely did not happen under .NET7 MAUI iOS releases up to and including the last one.

thanks

Niall





TP Tamilarasan Paranthaman Syncfusion Team November 23, 2023 03:02 PM UTC

Niall,


We have recently implemented some modifications in our source code related to “Syncfusion.Maui.GridCommon.ScrollAxis.RangeValuePair” and included these changes in our latest weekly NuGet release. We kindly request that you update the Syncfusion.Maui.DataGrid package to version 23.2.5 and check whether the issue you reported persists after this update.


https://www.nuget.org/packages/Syncfusion.Maui.DataGrid



NI Niall November 23, 2023 10:45 PM UTC

Hi Tamilarasan,


Thanks for updating/addressing this issue so quickly. I actually temporarily converted over the DataGrids to use the Telerik ones yesterday as I didn't think SF would have a fix this quickly. I'll do some testing later with original code.


However - there's a big bug in the 23.2.5 do with SfButton which is a real showstopper for us (so I don't think we can upgrade yet) - I'll post a separate thread for this.


Also - would be great if there was more comprehensive Release notes published to help us better understand what has changed in releases (ie. this issue above is not mentioned in the Release Notes for 23.2.5).


thanks

Niall




TP Tamilarasan Paranthaman Syncfusion Team November 24, 2023 12:35 PM UTC

Niall,



We are glad to know that the problem has been resolved at your end!!  We will add those details in our release notes. Please let us know if you require further assistance. As always, we are happy to help you out.


Regards,

Tamilarasan


Loader.
Up arrow icon