Default FontFamily

Goodmorning,

which is the default FontFamily for DataGridTextColumn in  SfDataGrid in windows system?

Thanks. Best regards.

Roberto




3 Replies

SD Sethupathy Devarajan Syncfusion Team February 14, 2025 06:01 AM UTC

Hi Roberto,


Please note that we haven't defined any default font family for the DataGridTextColumn. We have set it to null in our source, and the font family is applied based on the system specifications.


We can customize the font family with the help of styling in the DataGrid. We have shared the code snippet and a user guide link for your reference.


Code snippet:

Implicit Styling

<ContentPage xmlns:syncfusion="http://schemas.syncfusion.com/maui">
    <ContentPage.Resources>
        <Style TargetType="syncfusion:DataGridCell">
            <Setter Property="Background" Value="#AFD5FB"/>
            <Setter Property="TextColor" Value="#212121"/>
            <Setter Property="FontAttributes" Value="Italic"/>
            <Setter Property="FontSize" Value="14"/>
           
<Setter Property="FontFamily" Value="TimesNewRoman"/>
        </Style>
    </ContentPage.Resources>
</ContentPage>


Default Styling

 <syncfusion:SfDataGrid x:Name="sfGrid"

                        GridLinesVisibility="Both"

                        HeaderGridLinesVisibility="Both"

                        AutoGenerateColumnsMode="None"

                        ItemsSource="{Binding Employees}">

 

     <syncfusion:SfDataGrid.DefaultStyle>

         <syncfusion:DataGridStyle RowFontFamily="TimesNewRoman" />

     </syncfusion:SfDataGrid.DefaultStyle>

 

     <syncfusion:SfDataGrid.Columns>

         <syncfusion:DataGridNumericColumn MappingName="EmployeeID"

                                           Format="#"

                                           HeaderText="Employee ID" />

         <syncfusion:DataGridTextColumn MappingName="Name"

                                        HeaderText="Employee Name" />

         <syncfusion:DataGridTextColumn MappingName="Title"

                                        HeaderText="Designation" />

         <syncfusion:DataGridDateColumn MappingName="HireDate"

                                        HeaderText="Hire Date" />

     </syncfusion:SfDataGrid.Columns>

 

 </syncfusion:SfDataGrid>


UG link : https://help.syncfusion.com/maui/datagrid/styling#styling-record-cell

Regards,
Sethupathy D.



RB Roberto Becchetti February 14, 2025 07:38 AM UTC

Thanks. Regards,

Roberto



SD Sethupathy Devarajan Syncfusion Team February 14, 2025 10:35 AM UTC

Hi Roberto,

 

We hope our solution satisfies your requirement. please get back to us if you need any further assistance.
 

Regards,

Sethupathy D.


Loader.
Up arrow icon