Telerik MAUI DataGrid gives NotSupportedException error on target framework net8.0-windows10.0.19041.0

2 Answers 149 Views
DataGrid
Sebahattin
Top achievements
Rank 1
Iron
Iron
Sebahattin asked on 17 Oct 2024, 11:46 AM | edited on 17 Oct 2024, 11:47 AM

Hello,

if i use telerik maui version 6.6.0 RadDataGrid with target framework net8.0-windows10.0.19041.0 and Microsoft.Maui Controls 8.0.92 the following error occurs.

Thank you very much in advance.

Error:
Exception has been thrown by the target of an invocation.

 at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Telerik.Maui.Controls.SkiaSharp.WriteableBitmapUtils.GetByteBuffer(IBuffer buffer)
   at Telerik.Maui.Controls.SkiaSharp.RadSKXamlCanvas.CreateBitmap(Double width, Double height, SKSizeI& unscaledSize, Single& dpi)
   at Telerik.Maui.Controls.SkiaSharp.RadSKXamlCanvas.Paint(Double width, Double height)
   at Telerik.Maui.Controls.SkiaSharp.RadSKXamlCanvas.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IUIElementMethods.Arrange(IObjectReference _obj, Rect finalRect)
   at Microsoft.UI.Xaml.UIElement.Arrange(Rect finalRect)
   at Microsoft.Maui.ViewHandlerExtensions.PlatformArrangeHandler(IViewHandler viewHandler, Rect rect)
   at Microsoft.Maui.Handlers.ViewHandler`2.PlatformArrange(Rect rect)
   at Microsoft.Maui.Controls.VisualElement.ArrangeOverride(Rect bounds)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Arrange(Rect bounds)
   at Telerik.Maui.Controls.Compatibility.DataGrid.MasterArranger.UpdatePainterRootSize()
   at Telerik.Maui.Controls.Compatibility.DataGrid.MasterArranger.Arrange(IEnumerable`1 nodes)
   at Telerik.Maui.Controls.Compatibility.DataGrid.RadDataGrid.LateArrange()
   at Telerik.Maui.Controls.Compatibility.DataGrid.RadDataGrid.UpdateUI(Double x, Double y, Double width, Double height)
   at Telerik.Maui.Controls.Compatibility.DataGrid.RadDataGrid.ArrangeChildren(Rect bounds)
   at Telerik.Maui.Controls.RadLayoutManager.ArrangeChildren(Rect bounds)
   at Microsoft.Maui.Controls.Layout.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.MauiPanel.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.MauiPanel.ArrangeOverride(Size finalSize)
   at Microsoft.Maui.Platform.LayoutPanel.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IUIElementMethods.Arrange(IObjectReference _obj, Rect finalRect)
   at Microsoft.UI.Xaml.UIElement.Arrange(Rect finalRect)
   at Microsoft.Maui.ViewHandlerExtensions.PlatformArrangeHandler(IViewHandler viewHandler, Rect rect)
   at Microsoft.Maui.Handlers.ViewHandler`2.PlatformArrange(Rect rect)
   at Microsoft.Maui.Controls.VisualElement.ArrangeOverride(Rect bounds)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Arrange(Rect bounds)
   at Microsoft.Maui.Layouts.VerticalStackLayoutManager.ArrangeChildren(Rect bounds)
   at Microsoft.Maui.Controls.Layout.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.MauiPanel.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.MauiPanel.ArrangeOverride(Size finalSize)
   at Microsoft.Maui.Platform.LayoutPanel.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IUIElementMethods.Arrange(IObjectReference _obj, Rect finalRect)
   at Microsoft.UI.Xaml.UIElement.Arrange(Rect finalRect)
   at Microsoft.Maui.ViewHandlerExtensions.PlatformArrangeHandler(IViewHandler viewHandler, Rect rect)
   at Microsoft.Maui.Handlers.ViewHandler`2.PlatformArrange(Rect rect)
   at Microsoft.Maui.Controls.VisualElement.ArrangeOverride(Rect bounds)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Arrange(Rect bounds)
   at Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContent(IContentView contentView, Rect bounds)
   at Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(IContentView contentView, Rect bounds)
   at Microsoft.Maui.Controls.ScrollView.Microsoft.Maui.ICrossPlatformLayout.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Handlers.ScrollViewHandler.Microsoft.Maui.ICrossPlatformLayout.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.MauiPanel.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.MauiPanel.ArrangeOverride(Size finalSize)
   at Microsoft.Maui.Platform.ContentPanel.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IUIElementMethods.Arrange(IObjectReference _obj, Rect finalRect)
   at Microsoft.UI.Xaml.UIElement.Arrange(Rect finalRect)
   at Microsoft.Maui.ViewHandlerExtensions.PlatformArrangeHandler(IViewHandler viewHandler, Rect rect)
   at Microsoft.Maui.Handlers.ViewHandler`2.PlatformArrange(Rect rect)
   at Microsoft.Maui.Controls.ScrollView.ArrangeOverride(Rect bounds)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Arrange(Rect bounds)
   at Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContent(IContentView contentView, Rect bounds)
   at Microsoft.Maui.Controls.ContentPage.Microsoft.Maui.ICrossPlatformLayout.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.MauiPanel.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.MauiPanel.ArrangeOverride(Size finalSize)
   at Microsoft.Maui.Platform.ContentPanel.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.ArrangeOverride(IObjectReference _obj, Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.ArrangeOverride(IObjectReference _obj, Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.ArrangeOverride(IObjectReference _obj, Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IUIElementMethods.Arrange(IObjectReference _obj, Rect finalRect)
   at Microsoft.UI.Xaml.UIElement.Arrange(Rect finalRect)
   at Microsoft.Maui.Platform.WindowRootViewContainer.ArrangeOverride(Size finalSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)

2 Answers, 1 is accepted

Sort by
2
Yana
Telerik team
answered on 17 Oct 2024, 12:09 PM

Hi Sebahattin,

This exception is related to a known issue in SkiaSharp library with the WindowsSDK versions 0.0.19041.38 and above:

https://github.com/mono/SkiaSharp/issues/2999

As the DataGrid control is rendered through the SkiaSharp, the error is raised with it.  The good news is this issue is already resolved in the most recent Windows SDK version, so you just need to add the following line into your proj file:

<WindowsSdkPackageVersion>10.0.19041.54</WindowsSdkPackageVersion>

to make it work.

You can also take a look at our kb article on this: Resolving Managed Vtable Types NotSupportedException with Telerik .NET MAUI SkiaSharp controls on Windows.

Please give it a try and if you still experience any issues let me know.

Regards,
Yana
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Sebahattin
Top achievements
Rank 1
Iron
Iron
answered on 17 Oct 2024, 01:13 PM
Great, it works. Thank you very much.
Tags
DataGrid
Asked by
Sebahattin
Top achievements
Rank 1
Iron
Iron
Answers by
Yana
Telerik team
Sebahattin
Top achievements
Rank 1
Iron
Iron
Share this question
or