Back to Devexpress

TextColumnBase.FontFamily Property

maui-devexpress-dot-maui-dot-datagrid-dot-textcolumnbase-7ff3fd9d.md

latest2.6 KB
Original Source

TextColumnBase.FontFamily Property

Gets or sets the font name for the text in column’s cells. This is a bindable property.

Namespace : DevExpress.Maui.DataGrid

Assembly : DevExpress.Maui.DataGrid.dll

NuGet Package : DevExpress.Maui.DataGrid

Declaration

csharp
public string FontFamily { get; set; }

Property Value

TypeDescription
String

The font name.

|

Remarks

To apply a custom font to the cell text, add the font file to your solution, and then assign it to the grid column’s FontFamily property.

This example shows how to use the Verdana font.

  1. Add the font file to your platform-specific projects:

  2. In the App.xaml file, add the following lines to the ResourceDictionary section:

  3. Set the FontFamily property to the key defined for the custom font:

Note

The FontAttributes property affects the default font only. If you need to apply a bold or italic custom font to the text, use the corresponding font style file as described above.

You can also use the BackgroundColor/FontColor properties to configure the background and text color for the column’s cells, and the FontAttributes/FontSize properties to change the font of cells’ text.

To customize the appearance of a specific cell, handle the CustomCellAppearance event.

Use the Padding property to set the text padding for a column’s cells.

Example

The following example shows how to customize the appearance of a specific column in the grid:

xaml
<dxg:NumberColumn FontSize="18" 
                      FontColor="Brown" 
                      FontAttributes="Bold" 
                      BackgroundColor="LightGoldenrodYellow" />

See Also

TextColumnBase Class

TextColumnBase Members

DevExpress.Maui.DataGrid Namespace