How to change ForeGround in DataField

Thread is closed for posting
3 posts, 0 answers
  1. Max
    Max avatar
    2 posts
    Member since:
    Nov 2012

    Posted 16 Jun 2013 Link to this post

    I have a big trouble. I have spent to this too much time.
    How can i change color of header of DataField? Color dependences to System Theme by default...
    I tried change Foregroud option in DataField.EditorStyle, DataField.Style and others.. Plz help.
  2. Todor
    Todor avatar
    798 posts

    Posted 19 Jun 2013 Link to this post

    Hi Max,

    I have answered to your support ticket regarding the same question. I'm copying the answer here in case any one else wants to know how to edit the foreground of the header.

    RadDataForm internally uses different controls for editors and the style that is added to the EditorStyles has to target the specific editor. Then, depending on that control you need to change its foreground, you need to add its respective style. For example, if you need to change the foreground of an editor for a field that is of type string, you need to know that the editor is of type RadTextBox. Here's how you can change the foreground of that header:
    <telerikInput:DataField TargetProperty="Item1">
                    <Style TargetType="telerikPrimitives:RadTextBox">
                            <Setter Property="HeaderStyle">
                                            <Style TargetType="ContentControl">
                                                    <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
                     <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
                     <Setter Property="HorizontalAlignment" Value="Left"/>

    I have highlighted the foreground of the header that is currently the static resource PhoneSubtleBrush. You just need to change it to the value of your choice.

    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. Max
    Max avatar
    2 posts
    Member since:
    Nov 2012

    Posted 19 Jun 2013 Link to this post

    Thank you for amazing support!
Back to Top