We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfDataGrid crashes on initialization when Theme is applied

Thread ID:

Created:

Updated:

Platform:

Replies:

143809 Apr 5,2019 12:26 PM UTC Apr 16,2019 10:26 AM UTC Xamarin.Forms 3
loading
Tags: SfDataGrid
Michal
Asked On April 5, 2019 12:26 PM UTC

When using Theme in ResourceDictionary accordingly to documentation, sfDataGrid crashes application. Dark or light theme, with or without binding to data, doesn't matter, grid crashes . I have tried grid with own DataGridStyle and still crashes. Any suggestions? Thank you

app.xaml:

xmlns:syncTheme="clr-namespace:Syncfusion.XForms.Themes;assembly=Syncfusion.Core.XForms"

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <syncTheme:SyncfusionThemeDictionary>
                    <syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
                        <syncTheme:DarkTheme />
                    </syncTheme:SyncfusionThemeDictionary.MergedDictionaries>
                </syncTheme:SyncfusionThemeDictionary>

Exception:

{System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.SfDataGrid.XForms.ThemeGridStyle.OnDataGridBackgroundColorChanged(BindableObject bindable, Object oldValue, Object newValue)
   at Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent)
   at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes)
   at Xamarin.Forms.Element.OnSetDynamicResource(BindableProperty property, String key)
   at Xamarin.Forms.BindableObject.SetDynamicResource(BindableProperty property, String key, Boolean fromStyle)
   at Syncfusion.SfDataGrid.XForms.ThemeGridStyle..ctor()
   at Syncfusion.SfDataGrid.XForms.SfDataGrid.Syncfusion.XForms.Themes.IThemeElement.OnControlThemeChanged(String oldTheme, String newTheme)
   at Syncfusion.XForms.Themes.ThemeElement.OnControlThemeChanged(BindableObject bindable, Object oldValue, Object newValue)
   at Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent)
   at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes)
   at Xamarin.Forms.Element.OnSetDynamicResource(BindableProperty property, String key)
   at Xamarin.Forms.BindableObject.SetDynamicResource(BindableProperty property, String key, Boolean fromStyle)
   at Xamarin.Forms.Element.SetDynamicResource(BindableProperty property, String key)
   at Syncfusion.XForms.Themes.ThemeElement.InitializeThemeResources(Element element, String controlKey)
   at Syncfusion.SfDataGrid.XForms.SfDataGrid..ctor()
   at sfThemingTest.Views.GridPage.InitializeComponent()
   at sfThemingTest.Views.GridPage..ctor()
   at sfThemingTest.Views.MainPage.<NavigateFromMenu>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at sfThemingTest.Views.MenuPage.<<-ctor>b__3_0>d.MoveNext()}


Michal
Replied On April 5, 2019 12:28 PM UTC

Tested with Xam 3.4 and 3.6, Sf 17.0.1.38, uwp and android

Subburaj Pandian Veluchamy [Syncfusion]
Replied On April 8, 2019 01:38 PM UTC

Hi Michal, 
  
Thank you for contacting Syncfusion support. 
  
Based on the provided information, we have checked and we can able to replicate the mentioned issue “Throws null exception when setting Theme to DataGrid” in Application Xamarin.Forms and logged issue report for the same. We will fix the issue and include this in our upcoming weekly NuGet release update which is expected be available by next week (April 17, 2019). We appreciate your patience until then. 
   
Regards,
Subburaj Pandian V 


Subburaj Pandian Veluchamy [Syncfusion]
Replied On April 16, 2019 10:26 AM UTC

Hi Michal,

We have fixed the reported issue “Throws null exception when setting Theme to DataGrid” in Xamarin.Forms and included the issue fix in our latest weekly NuGet package update version 17.1.0.41 and is available for download (nuget.org). 
 
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance. 
 
Regards,
Subburaj Pandian V 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon