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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to display custom font in GridCell ?

SfDataGrid allows you to display custom fonts in GridCell using GridColumn.RecordFont Property. For that we need to set the GridColumn.LoadUIView property as true.

Follow the below steps in each platform to add the custom font.

Xamarin.Forms.Android:

  • Add your “Font.ttf” file to the Assets folder in your Xamarin.Forms.Android project.

 

  • Right click your font file from the solution explorer and in the properties menu change the BuildAction property of your font file to AndroidAsset and CopyToOutputDirectory as DoNotCopy.

 

Untitled picture.png Machine generated alternative text:
a Advanced 
Build Action 
Copy to Output Directory 
Custom Tool 
Custom Tool Namespace 
AndroidAsset 
Do not copy 
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings

 

Xamarin.Forms.iOS

  • Add your “Font.ttf” file to the Resources folder in your Xamarin.Forms.iOS project.

 

  • Right click your font file from the solution explorer and in the properties menu change the BuildAction property of your font file to BundlerResource and CopyToOutputDirectory as CopyAlways.
  • In addition to this you should edit the Info.PList file of your Xamarin.Forms.iOS project. Refer the info.PList section from the below link to edit the same.
    Link: https://blog.xamarin.com/custom-fonts-in-ios 

 

Untitled picture.png Machine generated alternative text:
E Advanced 
Build Action 
Copy to Output Directory 
Custom Tool 
Custom Tool Namespace 
BundleResource 
Copy always 
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings

 

 

 Xamarin.Forms.UWP:               

  • Add your “Font.ttf” file to the Assets\Fonts folder in your Xamarin.Forms.UWP project.

 

  • Right click your font file from the solution explorer and in the properties menu change the BuildAction property of your font file to Content and CopyToOutputDirectory as DoNotCopy.

 

Untitled picture.png Machine generated alternative text:
g Advanced 
Build Action 
Copy to Output Directory 
Custom Tool 
Custom Tool Namespace 
Content 
Do not copy 
Ink Drawings
Ink Drawings
Ink Drawings
Ink Drawings

 

 

The below code example illustrates how to display custom font in GridCell using RecordFont property.

 

Refer the following screenshot that shows the outcome upon execution of the above code.

 

Sample Link:

How to display custom font in GridCell?

 

 

Article ID: Published Date: Last Revised Date: Platform: Control: Product Version:
7826 07/06/2017 07/06/2017 Xamarin.Forms SfDataGrid 13.4.0.53
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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