Hi,
Using VS 2022 17.10 / .NET 8.0.3 / Telerik UI for MAUI 6.8 / MAUI 8.0.10 / Android 10 (API 29)
I've got a RadGridView on a ContentPage :
<c:NDCDataGrid
x:Name="dataGridDetails"
ItemsSource="{Binding DetailedData}">
<t:RadDataGrid.Columns>
<t:DataGridTextColumn HeaderText="Location" PropertyName="LocationName" />
<t:DataGridTextColumn
CellContentFormat="{}{0: dd/MM/yyyy}"
HeaderText="Date"
PropertyName="Date" />
<t:DataGridTextColumn HeaderText="Count" PropertyName="Count" />
<t:DataGridTextColumn HeaderText="Type" PropertyName="Desc" />
</t:RadDataGrid.Columns>
</c:NDCDataGrid>
My NDCDataGrid is defined like this :
<t:RadDataGrid
x:Class="NDC.Mobile.Controls.NDCDataGrid"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:t="http://schemas.telerik.com/2022/xaml/maui"
AutoGenerateColumns="False"
CanUserReorderColumns="False"
SelectionMode="Single"
SelectionUnit="Row"
UserFilterMode="Disabled">
<t:RadDataGrid.AlternateRowBackgroundStyle>
<AppThemeBinding>
<AppThemeBinding.Light>
<t:DataGridBorderStyle
BackgroundColor="Beige"
BorderColor="Black"
BorderThickness="1" />
</AppThemeBinding.Light>
<AppThemeBinding.Dark>
<t:DataGridBorderStyle
BackgroundColor="DimGray"
BorderColor="White"
BorderThickness="1" />
</AppThemeBinding.Dark>
</AppThemeBinding>
</t:RadDataGrid.AlternateRowBackgroundStyle>
<t:RadDataGrid.SelectionStyle>
<AppThemeBinding>
<AppThemeBinding.Light>
<t:DataGridBorderStyle
BackgroundColor="LightGreen"
BorderColor="Black"
BorderThickness="1" />
</AppThemeBinding.Light>
<AppThemeBinding.Dark>
<t:DataGridBorderStyle
BackgroundColor="DarkBlue"
BorderColor="White"
BorderThickness="1" />
</AppThemeBinding.Dark>
</AppThemeBinding>
</t:RadDataGrid.SelectionStyle>
</t:RadDataGrid>
When loading a list of 900+ elements, the app crashes
await Task.Run(async () =>
{
DetailedData = new ObservableCollection<MyType>(await myService.Method());
});
MyType is defined like this :
public int LocationName { get; set; }
public int Count { get; set; }
public DateTime Date { get; set; }
public string Desc { get; set; }
Java.Lang.RuntimeException: 'Canvas: trying to draw too large(119964240bytes) bitmap.'
0xFFFFFFFFFFFFFFFF in Android.Runtime.RuntimeNativeMethods.monodroid_debugger_unhandled_exception C# 0x1A in Android.Runtime.JNINativeWrapper._unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:13,5 C# 0x1E in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:126,26 C# 0x17 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw C# 0x8C in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:20830,5 C# 0x2D in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeNonvirtualVoidMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:93,6 C# 0xA6 in Android.Graphics.RecordingCanvas.DrawBitmap at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Graphics.RecordingCanvas.cs:161,5 C# 0x68 in SkiaSharp.Views.Android.SurfaceFactory.DrawSurface C# 0xCB in SkiaSharp.Views.Android.SKCanvasView.OnDraw C# 0x11 in Android.Views.View.n_OnDraw_Landroid_graphics_Canvas_ at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:18998,4 C# 0x9 in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:125,5 C# 0xF in Java.Interop.JniNativeMethods.CallNonvirtualBooleanMethodA at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:18200,4 C# 0x73 in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualBooleanMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:20458,4 C# 0x8A in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualBooleanMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:164,7 C# 0x70 in Android.Views.ViewGroup.DrawChild at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.ViewGroup.cs:2839,5 C# 0x4 in Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.DrawChild at D:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\Android\ShellFlyoutRenderer.cs:172,4 C# 0x1C in Android.Views.ViewGroup.n_DrawChild_Landroid_graphics_Canvas_Landroid_view_View_J at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.ViewGroup.cs:2824,4 C# 0xD in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLJ_Z at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:323,5 C#
The control is unusable in this state !
Thanks.
Hello Jérôme,
Thank you for sending the code snippets.
I've recreated the scenario in a sample app, still, I am not able to reproduce the reported crash. I've attached my test app, can you please download it and test it on your side? Do you reproduce the issue with it? If not, can you modify it with any additional code that I am missing, so that the crash can be seen and sent it back for further research?
I look forward to your reply.
Regards,
Yana
Progress Telerik
Hi Yana,
Thank you for your answer. I adjusted your project in order to replicate the issue.
It seems the problem comes from my BaseContentPage that all my ContentPage inherit from.
Any help is appreciated.
Jérôme