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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to display custom font in GridCell ?

Platform: Xamarin.Forms |
Control: SfDataGrid |
Product Version: 13.4.0.53

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?

 

 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile