Silverlight RadDataGrid -Header cell foreground, fontsize, font family doesn't change the value

2 posts, 0 answers
  1. Hanh
    Hanh avatar
    1 posts
    Member since:
    Aug 2011

    Posted 02 Sep 2011 Link to this post

    Hi,
    I am trying to apply style on header cell for raddatagrid, however I only get the background works, other properties belong to font like: foreground, fontsize, fontfamily doesn't work. Could you please help.
    I only have the trial version, I don't know that is the reason why? I use silverlight for my work project because it looks cool.But I need to show them the demostration first before ask them to buy the product.

    here are my code:

    First, I define style:

     

     

     

    <Style x:Key="MyHeaderCellStyle" TargetType="telerik:GridViewHeaderCell">

     

     

     

     

    <Setter Property="Background" Value="#00bfff" />

     

     

     

     

    <Setter Property="Foreground" Value="White"></Setter>

     

     

     

     

    <Setter Property="FontSize" Value="7" />

     

     

     

     

    <Setter Property="FontFamily" Value="Verdana"></Setter>

     

     

     

     

    </Style>

     




    then I add it to my ragrid

     

     

     

    <telerik:RadGridView Name="grdTransactions" IsReadOnly="True" ItemsSource="{Binding ElementName=srcTransaction, Path=Data}" AutoGenerateColumns="False"

     

     

     

    Visibility="Collapsed" MinHeight="100" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" CanUserResizeColumns="False">

     

     

     

     

    <telerik:RadGridView.Columns>

     

     

     

     

    <telerik:GridViewDataColumn Header="Org Credit" DataMemberBinding="{Binding OrigninalCreditAmount}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}" ></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn Header="Org Debit" DataMemberBinding="{Binding OrigninalDebitAmount}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn Header="Org Currency" DataMemberBinding="{Binding OriginalCurrencyCode}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn Header="Func Credit" DataMemberBinding="{Binding FunctionalCreditAmount}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn Header="Func Debit" DataMemberBinding="{Binding FunctionalDebitAmount}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn Header="Func Currency" DataMemberBinding="{Binding FunctionalCurrencyCode}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn Header="Rpt Currency" DataMemberBinding="{Binding ReportCurrencyCode}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Account}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding CostCenter}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Identifier}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Intent}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Project}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding FixedAsset}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Currency}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding CounterParty}" HeaderCellStyle="{StaticResource MyHeaderCellStyle}"></telerik:GridViewDataColumn>

     

     

     

     

    </telerik:RadGridView.Columns>

     

     

     

     

    </telerik:RadGridView>

     

  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 03 Sep 2011 Link to this post

    Hi Hanh,

     

    Thank you for sharing this snippet with us! I have tried to replicate the behavior you described, but I was not able to. Indeed everything works fine by my side and the HeaderCellStyle is applied correctly. 
    Please check the attached project and let me know how it differs from yours. 


    Greetings,
    Vanya Pavlova
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top