Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Modify Font Family of RoyalDark Themed XamDataGrid
posted

I have a XamDataGrid using the theme "RoyalDark", which uses "Segoe UI" by default. Is there a way to change the font family on a particular column?

Thanks,

Ethan Shattuck

  • 18044
    Suggested Answer
    Offline posted

    Hi Ethan,

    Thank you for posting in our forums!

    The XamDataGrid uses some of our Editors in their templates.  So you will want to target their FontFamily for the font you want to use and then set the Field's EditorStyle property to use the keyed Style you create.

    You can see an example of this in my following code snippet.

    <Grid>
        <Grid.Resources>
            <Style x:Key="SpecialFont" TargetType="{x:Type igEditors:XamTextEditor}" BasedOn="{x:Static igThemes:EditorsRoyalDark.XamTextEditor}">
                <Setter Property="FontFamily" Value="Times New Roman" />
            </Style>
        </Grid.Resources>
        <igDP:XamDataGrid Theme="RoyalDark" BindToSampleData="True">
            <igDP:XamDataGrid.FieldLayouts>
                <igDP:FieldLayout>
                    <igDP:FieldLayout.Fields>
                        <igDP:TextField Name="name" EditorStyle="{StaticResource SpecialFont}" />
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataGrid.FieldLayouts>
        </igDP:XamDataGrid>
    </Grid>

    If you have any further questions or concerns with this, please let me know.