Category / Section
                                    
                                How to render SfDataGrid for Xamarin.Forms.UWP in release mode?
                
                
                    1 min read
                
            
    Currently SfDataGrid does not render in release mode in Xamarin.Forms.UWP. This is a known Framework issue in the Xamarin.Forms.UWP platform. The custom controls will not render when deploying the application in release mode. Please refer the below Bugzilla link for more details.
https://bugzilla.xamarin.com/show_bug.cgi?id=45617
Workaround:
The above problem can be resolved by passing the assemblies to include when initializing the Xamarin.Forms in App.xaml.cs in the UWP project as mentioned in the below code example.
if (rootFrame == null)
{
    // Create a Frame to act as the navigation context and navigate to the first page
    rootFrame = new Frame();
 
    rootFrame.NavigationFailed += OnNavigationFailed;
 
    List<Assembly> assembliesToInclude = new List<Assembly>();
 
    //Now, add in all the assemblies your app uses 
    assembliesToInclude.Add(typeof(SfDataGridRenderer).GetTypeInfo().Assembly);
 
    //Also do this for all your other 3rd party libraries 
 
    Xamarin.Forms.Forms.Init(e,assembliesToInclude);
    // Xamarin.Forms.Forms.Init(e);
 
    if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
    {
        //TODO: Load state from previously suspended application
    }
 
    // Place the frame in the current Window
    Window.Current.Content = rootFrame;
}
Sample Link:
