This is a migrated thread and some comments may be shown as answers.

How to change ForeGround in DataField

2 Answers 60 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Max
Top achievements
Rank 1
Max asked on 16 Jun 2013, 03:20 PM
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 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 19 Jun 2013, 06:07 AM
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">
        <telerikInput:DataField.EditorStyles>
                <Style TargetType="telerikPrimitives:RadTextBox">
                        <Setter Property="HeaderStyle">
                                <Setter.Value>
                                        <Style TargetType="ContentControl">
                                                <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
                 <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
                 <Setter Property="HorizontalAlignment" Value="Left"/>
         </Style>
                 </Setter.Value>
                        </Setter>
                </Style>
        </telerikInput:DataField.EditorStyles>
</telerikInput:DataField>

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.

Regards,
Todor
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Max
Top achievements
Rank 1
answered on 19 Jun 2013, 01:41 PM
Thank you for amazing support!
Tags
DataForm
Asked by
Max
Top achievements
Rank 1
Answers by
Todor
Telerik team
Max
Top achievements
Rank 1
Share this question
or