Posted 16 October 2017, 7:12 am EST
I’m trying to use the FlexGrid in Xamarin.Forms. I have added the C1.Xamarin.Forms.Grid NuGet package and all of its dependencies. Intellisense picks up the FlexGrid control for use in XAML and C#. I have also added ```
FlexGridRenderer.Init();
However, when I run the app on UWP, I get the error:
Could not load type 'Xamarin.Forms.Platform.UWP.FormsTimePicker' from assembly 'Xamarin.Forms.Platform.UAP.
Stack trace:
System.TypeLoadException: Could not load type 'Xamarin.Forms.Platform.UWP.FormsTimePicker' from assembly 'Xamarin.Forms.Platform.UAP, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.
at C1.Xamarin.Forms.Grid.Platform.UWP.FlexGridRendererCellFactory.GetNativeElement(View view, Element parent)
at C1.Xamarin.Forms.Grid.Platform.UWP.FlexGridRendererCellFactory.CreateCellContent(GridCellType cellType, GridCellRange range, Object cellContentType)
at C1.UWP.Grid.GridCellFactory.CreateCellContent
I'm trying to show a very basic grid at this point.
<c1:FlexGrid
x:Name=“TheGrid”
AutoGenerateColumns=“True” />
TheGrid.ItemsSource = new List() {
“test1”, “test2”
};
This may have something to do with using a Shared Project vs a PCL when creating the Xamarin.Forms solution. I followed these steps initially in an existing Shared Project and I received the error above. I then followed these steps in an existing PCL project and it seemed to work just fine. After that, I created a brand new Shared Project, followed the steps, and got the same error.