Label styling in code-behind

3 posts, 1 answers
  1. FirstName
    FirstName avatar
    6 posts
    Member since:
    Sep 2017

    Posted 27 Sep 2017 Link to this post

    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. Answer
    Vladimir Stoyanov
    Vladimir Stoyanov avatar
    114 posts

    Posted 29 Sep 2017 Link to this post


    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:Label Foreground="Red" Content="{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}"/>

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

    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.
  3. FirstName
    FirstName avatar
    6 posts
    Member since:
    Sep 2017

    Posted 31 Oct 2017 Link to this post

    Thanks a lot, Vladimir
Back to Top