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

Label styling in code-behind

2 Answers 275 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
FirstName
Top achievements
Rank 1
FirstName asked on 28 Sep 2017, 02:11 AM

Hi, is there any way I can style label for DataFormDataField inside code-behind file or XAML ? For example, I have such layout and need to change label's foreground color:

<telerik:DataFormDataField x:Name="someNameHere" VerticalAlignment="Top" Grid.Row="2" Grid.Column="1" Label="{Binding Source={x:Static p:Resources.someValue}, Mode=OneTime, StringFormat='{}{0} :'}">                     

    <telerik:RadDateTimePicker x:Name="datePicker" SelectedDate="{Binding ControlDefinition.selectedDate, StringFormat='{}{0:T} {0:d}', Mode=TwoWay}"/>               </telerik:DataFormDataField>

 

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 29 Sep 2017, 05:03 PM
Hello,

You can set the foreground color of the label like this:  

<telerik:DataFormDataField x:Name="someNameHere" VerticalAlignment="Top" Grid.Row="2" Grid.Column="1" >
        <telerik:DataFormDataField.Label>
            <telerik:Label Foreground="Red" Content="{Binding Source={x:Static p:Resources.someValue}, Mode=OneTime, StringFormat='{}{0} :'}">
            </telerik:Label>
        </telerik:DataFormDataField.Label>
        <telerik:RadDateTimePicker x:Name="datePicker" SelectedDate="{Binding ControlDefinition.selectedDate, StringFormat='{}{0:T} {0:d}', Mode=TwoWay}"/>
</telerik:DataFormDataField>

I hope you find this helpful. Let me know if I can be of any further assistance.

Regards,
Vladimir Stoyanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
FirstName
Top achievements
Rank 1
answered on 31 Oct 2017, 08:16 PM
Thanks a lot, Vladimir
Tags
DataForm
Asked by
FirstName
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
FirstName
Top achievements
Rank 1
Share this question
or