This is a migrated thread and some comments may be shown as answers.

RadDataGrid Cross- platform

3 Answers 176 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Sarada
Top achievements
Rank 1
Sarada asked on 30 Apr 2020, 05:03 PM

I'm currently working on building a crossplatform application using xamarin forms. So I started with building a Class Library and added the RadDataGrid and the output can either be a Android or UWP or WPF.

I can get the sample data to be displayed in Android but i get an below issue(attached)

 

 

3 Answers, 1 is accepted

Sort by
0
Lance | Senior Manager Technical Support
Telerik team
answered on 30 Apr 2020, 08:13 PM

Hello Sarada,

The reason for your problems is that we do not support WPF in Xamarin.Forms. At this time, we do not have plans to add WPF to UI for Xamarin because we already have a very large and robust UI suite for WPF, see Telerik UI for WPF.

You can still upvote the Add WPF Feature Request to show your support and increase the interest level.

Here is my recommended structure if you want to add a WPF head:

  • A .NET Standard 2.0 class library to hold all the common business logic
  • Xamarin.Forms for the Android, iOS and UWP UI layer (using Telerik UI for Xamarin)
  • A separate .NET Core 3.0 WPF project for the WPF UI layer (using Telerik UI for WPF). 

    Demo

    I've gone ahead and written a demo for the concept idea, find it attached.

    In the solution will see a

    • SaradaDataGrid.Common -  All sharable code and business logic goes here
    • SaradaDataGrid.Wpf - A WPF project (references the Common project)
    • SaradaDataGrid.Portable - this is the Xamarin.Forms project (references the Common project)
      • SaradaDataGrid.Android - An Xamarin.Android project (references the Xamarin.Forms project)
      • SaradaDataGrid.iOS - A Xamarin.iOS project (references the Xamarin.Forms project)
      • SaradaDataGrid.UWP -  A Windows 10 UWP project (references the Xamarin.Forms project)

    A screenshot may help better explain:

    Now you can use the same data models, service classes and view models with any of the projects.

    Important Note: The WPF project is referencing Telerik UI for WPF packages. If you do not already have UI for WPF, please start a new trial here. After you install UI for WPF, the WPF project's NuGet packages will be able to be restored (see nuget.config).

    Runtime Screenshots

    WPF project's MainWindow.xaml

      Xamarin.Forms project's MainPage.xaml

      WPF runtime:

      Android runtime:

      Further Assistance

      If you have any further trouble, please open a new Support Ticket here. You have full Technical Support during your trial, which lets you talk directly to the relevant engineering team.

      I hope my reply answers your question and I've provided you with a direction to move forward for all the platforms.

      Regards,
      Lance | Team Lead - US DevTools Support
      Progress Telerik

      Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
      Our thoughts here at Progress are with those affected by the outbreak.
      0
      vinay
      Top achievements
      Rank 1
      answered on 05 Oct 2020, 08:37 AM
      I'm developing multi lingual app using Xamarin and I have an Issue with displaying the header text for RadaDataGrid only for Japanese language. Issue is text displayed as boxes on grid header when language is Japanese. for other controls like button, label, entry are fine. Here i have attached the image 
      0
      Didi
      Telerik team
      answered on 05 Oct 2020, 09:38 AM

      Hi Vinay,

      Indeed, this is a known issue related to Unicode characters and the reason behind is the Skia library we're using for rendering the DataGrid. You can learn more about it in the following feedback item:

      DataGrid: [Android][UWP] Some languages are not properly rendered by SkiaSharp elements

      Workaround:

      As you want to display Japanese characters inside the header, you will need to define HeaderContentTemplate for each column. For example:

      <telerikDataGrid:RadDataGrid x:Name="grid" 
                  ItemsSource="{Binding Clubs}" 
                  AutoGenerateColumns="False" 
                  UserEditMode="Cell">
          <telerikDataGrid:RadDataGrid.Columns>
              <telerikDataGrid:DataGridTextColumn PropertyName="Name" >
                  <telerikDataGrid:DataGridTextColumn.HeaderContentTemplate>
                      <DataTemplate>
                          <Label Text=" おはよう"/>
                      </DataTemplate>
                  </telerikDataGrid:DataGridTextColumn.HeaderContentTemplate>
                  <telerikDataGrid:DataGridTextColumn.CellContentStyle>
                      <telerikDataGrid:DataGridTextCellStyle TextColor="Green" 
                                      FontSize="15" 
                                      SelectedTextColor="Orange"  />
                  </telerikDataGrid:DataGridTextColumn.CellContentStyle>
              </telerikDataGrid:DataGridTextColumn>
      

      The same approach has to be used for displaying text inside the columns using the CellContentTemplate property.

      The feedback item contains a workaround for the issue, also you can check the following how-to article for more details: https://docs.telerik.com/devtools/xamarin/knowledge-base/datagrid-languages-not-rendered-properly-skia

      Regards,
      Didi
      Progress Telerik

      Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

      Tags
      DataGrid
      Asked by
      Sarada
      Top achievements
      Rank 1
      Answers by
      Lance | Senior Manager Technical Support
      Telerik team
      vinay
      Top achievements
      Rank 1
      Didi
      Telerik team
      Share this question
      or