When testing DevExpress DataGridView control in an Uno Platform application with MAUI Embedding, ObjCRuntime.RuntimeException is thrown when using CheckBoxColumn or TemplateColumn for the columns on iOS.
For CheckBoxColumn:
ObjCRuntime.RuntimeException
Message=Unable to marshal the parameter unoplatform/uno#1 whose managed type is 'UIKit.UIView' to managed.
Additional information:
Selector: onSelectionChanged:andRowIndex:andCellIndex:
Method: DevExpress.Maui.DataGrid.iOS.Internal.GridActionDelegate:OnSelectionChanged (UIKit.UIView,int,int)
Source=Microsoft.iOS
StackTrace:
at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 2594
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 60
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94
at DevExpressApp.iOS.EntryPoint.Main(String[] args) in C:\Dev\Samples\Maui Embedding\DevExpress\Cli\DevExpressApp\DevExpressApp\Platforms\iOS\Main.iOS.cs:line 12
Related CallStack:
0x28 in ObjCRuntime.Runtime.ThrowException at /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:2594,4 C#
0x23 in UIKit.UIApplication.UIApplicationMain at /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:60,4 C#
0x51 in UIKit.UIApplication.Main at /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:94,4 C#
> 0xD in DevExpressApp.iOS.EntryPoint.Main at C:\Dev\Samples\Maui Embedding\DevExpress\Cli\DevExpressApp\DevExpressApp\Platforms\iOS\Main.iOS.cs:12,9 C#
0x28 in ObjCRuntime.Runtime.ThrowException at /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:2594,4 C#
0x23 in UIKit.UIApplication.UIApplicationMain at /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:60,4 C#
0x51 in UIKit.UIApplication.Main at /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:94,4 C#
> 0xD in DevExpressApp.iOS.EntryPoint.Main at C:\Dev\Samples\Maui Embedding\DevExpress\Cli\DevExpressApp\DevExpressApp\Platforms\iOS\Main.iOS.cs:12,9 C#
Expected behavior
No exceptions and no crashes for the app like for Android.
How to reproduce it (as minimally and precisely as possible)
Uncomment the CheckBoxColumn or TemplateColumn in the DataGridView in EmbeddedControl.xaml
Launch the application for iOS, notice the ObjCRuntime.RuntimeException, and the app crashes after that.
Workaround
None at the moment
Works on UWP/WinUI
None (Only compatible with Android and iOS)
Environment
Uno.Sdk
NuGet package version(s)
Uno.Sdk:
"Uno.Sdk": "5.2.132"
OR
"Uno.Sdk": "5.3.0-dev.1877"
Uno.Extensions:
<UnoExtensionsVersion>4.1.23</UnoExtensionsVersion>
OR
<UnoExtensionsVersion>4.2.0-dev.81</UnoExtensionsVersion>
DevExpress.Maui.DataGrid:
Version 23.2.5
OR
Version 23.2.6
OR
Version 24.1.2-beta
Maui version: 8.0.21
Affected platforms
iOS
IDE
Visual Studio 2022
IDE version
17.10.1
Relevant plugins
N/A
Anything else we need to know?
No exception when testing the same code with a maui sample application using DevExpress.Maui.DataGrid version23.2.6 and Maui version8.0.21. (DevExpress-Examples maui-DataGridExample.zip)
Current behavior
When testing DevExpress
DataGridView
control in an Uno Platform application with MAUI Embedding, ObjCRuntime.RuntimeException is thrown when usingCheckBoxColumn
orTemplateColumn
for the columns on iOS.For
CheckBoxColumn
:Related CallStack:
For
TemplateColumn
:Related CallStack:
Expected behavior
No exceptions and no crashes for the app like for Android.
How to reproduce it (as minimally and precisely as possible)
CheckBoxColumn
orTemplateColumn
in theDataGridView
Launch the application for iOS, notice the
ObjCRuntime.RuntimeException
, and the app crashes after that.Sample repro app: DevExpressApp.zip
CheckBoxColumn
orTemplateColumn
in theDataGridView
inEmbeddedControl.xaml
ObjCRuntime.RuntimeException
, and the app crashes after that.Workaround
None at the moment
Works on UWP/WinUI
None (Only compatible with Android and iOS)
Environment
Uno.Sdk
NuGet package version(s)
"Uno.Sdk": "5.2.132"
OR"Uno.Sdk": "5.3.0-dev.1877"
<UnoExtensionsVersion>4.1.23</UnoExtensionsVersion>
OR<UnoExtensionsVersion>4.2.0-dev.81</UnoExtensionsVersion>
23.2.5
OR Version23.2.6
OR Version24.1.2-beta
8.0.21
Affected platforms
iOS
IDE
Visual Studio 2022
IDE version
17.10.1
Relevant plugins
N/A
Anything else we need to know?
No exception when testing the same code with a maui sample application using DevExpress.Maui.DataGrid version
23.2.6
and Maui version8.0.21
. (DevExpress-Examples maui-DataGridExample.zip)Related sample code: https://github.com/DevExpress-Examples/maui-data-grid/tree/23.2.3%2B/CS/DataGridExample