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
120
Override and change theme's font size
posted

Hi,

I have a XamDataGrid with Theme="Metro"

However, I find that the default FontSize of the Metro theme is too big, I would like to have a smaller FontSize but at the same time would like to maintain the Metro theme.

I've tried setting a BasedOn style in the XamDataGrid's resources, but it is not working, the FontSize remains the same.

<igDP:XamDataGrid Name="xamDataGrid1" Grid.Row="1" Grid.Column="0" DataSource="{Binding dt}" Theme="Metro" HorizontalAlignment="Left" AllowDrop="True" BorderBrush="Black" Visibility="{Binding GridVisi}">

    <igDP:XamDataGrid.Resources>
        <Style TargetType="{x:Type igDP:XamDataGrid}" BasedOn="{x:Static igThemes:DataPresenterMetro.XamDataGrid}">
            <Setter Property="FontSize" Value="5" />
        </Style>
    </igDP:XamDataGrid.Resources>

<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings/>
</igDP:XamDataGrid.FieldLayoutSettings>

<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings AllowLabelVirtualization="True" AllowRecordFiltering="True"/>
</igDP:XamDataGrid.FieldSettings>

<igDP:XamDataGrid.ViewSettings>
<igDP:GridViewSettings Orientation="Vertical" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Visible"/>
</igDP:XamDataGrid.ViewSettings>


</igDP:XamDataGrid>