How to show chinese characters

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    1 posts
    Member since:
    Nov 2017

    Posted 30 Nov 2017 Link to this post

    I am just doing some test with this control. I found an issue that Grid header text can't show chinese characters correctly.

    Here is my XAML.

     

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:telerikPrimitives="clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives"
                 xmlns:telerikDataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"
                 xmlns:telerikChart="clr-namespace:Telerik.XamarinForms.Chart;assembly=Telerik.XamarinForms.Chart"
                 xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
                 xmlns:telerikGauges="clr-namespace:Telerik.XamarinForms.DataVisualization.Gauges;assembly=Telerik.XamarinForms.DataVisualization"
                 xmlns:telerikDataGrid="clr-namespace:Telerik.XamarinForms.DataGrid;assembly=Telerik.XamarinForms.DataGrid"
                 x:Class="TelerikXamarinApp2.Portable.StartPage">
        <StackLayout>
            <Label Text="You are ready to use all controls from UI for XamarinForms suite." HorizontalOptions="Center" VerticalOptions="Center"/>
            <telerikInput:RadMaskedInput></telerikInput:RadMaskedInput>
            <!--<telerikInput:RadCalendar></telerikInput:RadCalendar>-->
            <telerikDataGrid:RadDataGrid x:Name="DataGrid" UserEditMode="Cell" AutoGenerateColumns="False">
                <telerikDataGrid:RadDataGrid.Columns>
                    <telerikDataGrid:DataGridTextColumn PropertyName="Country"
                                                HeaderText="国家">
                        <telerikDataGrid:DataGridTextColumn.CellContentStyle>
                            <telerikDataGrid:DataGridTextCellStyle TextColor="Green" 
                                                           FontSize="15" 
                                                           SelectedTextColor="Orange"  />
                        </telerikDataGrid:DataGridTextColumn.CellContentStyle>
                    </telerikDataGrid:DataGridTextColumn>
                    <telerikDataGrid:DataGridTextColumn PropertyName="Capital"
                                                    HeaderText="Capital">
                        <telerikDataGrid:DataGridTextColumn.CellContentStyle>
                            <telerikDataGrid:DataGridTextCellStyle TextColor="Green" 
                                                               FontSize="15" 
                                                               SelectedTextColor="Orange"  />
                        </telerikDataGrid:DataGridTextColumn.CellContentStyle>
                    </telerikDataGrid:DataGridTextColumn>
                </telerikDataGrid:RadDataGrid.Columns>
            </telerikDataGrid:RadDataGrid>
        </StackLayout>
    </ContentPage>

    Please give me some advice.

    Thanks.

    Kevin

     

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    639 posts

    Posted 04 Dec 2017 Link to this post

    Hello, Kevin,

    I have managed to reproduce the behavior and logged it as a bug at our end. Here is the public item which you can follow - DataGrid: [Android][UWP]Some languages are not properly rendered by SkiaSharp elements. You can subscribe to the item in order to automatically receive notifications when some updates are available.

    Basically, the issue is present in Android and UWP and not in iOS because the first two platforms we are using SkiaSharp to render the elements within the RadDataGrid. In iOS, on the other hand, we are creating native UILabels. As a workaround, you can set a template to the Header of the column instead of the HeaderText. For example:

    <telerikDataGrid:DataGridTextColumn.HeaderContentTemplate>
        <DataTemplate>
            <Label Text="国家"></Label>
        </DataTemplate>
    </telerikDataGrid:DataGridTextColumn.HeaderContentTemplate>

    Have a great week.

    Regards,
    Stefan Nenchev
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top