Label Color

4 posts, 1 answers
  1. SDI
    SDI avatar
    107 posts
    Member since:
    Nov 2011

    Posted 02 May 2013 Link to this post

    Is there a way to change the label color of an Input control in code-behind, w/o using LabelCssClass? Attribute?

    I have custom theming and it changes in the ItemCreated event. Could be all kinds of colors, reading from a internal Class. So i need it to change in the server-side code. RadTextBox.ForeColor - works great, what about the Label?

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 May 2013 Link to this post


    The look of the label text is determined by the Skin property of the RadInput control. When you set the Skin property, the LabelCssClass property is automatically set to "riLabel". You can substitute your own CSS class to change the appearance of the label by setting the LabelCssClass property.
    RadTextBox1.LabelCssClass = "MyLabelStyle";
    .RadInput_Skinname .MyLabelStyle.riLabel
             font-weight:bolder !important;
             color:Blue !important;

  3. SDI
    SDI avatar
    107 posts
    Member since:
    Nov 2011

    Posted 03 May 2013 Link to this post

    Thats what i was afraid of. Only in CSS for the label child of the RadTextBox, but a parent property for the RadTextBox itself. Maybe Telerik can have the developers expose these type of properties to the server for the label control of the input controls in a future release.
  4. Answer
    Venelin avatar
    352 posts

    Posted 07 May 2013 Link to this post

    Hi Brian,

    I am afraid there is no way to set ForeColor of a label using code-behind. If you want, you can use the asp label control instead:

    <asp:Label runat="server" Text="ASPLabel: " ForeColor="Red"></asp:Label>

    Also, you can log this in our Feedback Portal, the place for bugs, ideas, suggestions etc. There is a voting system and we do take into consideration the voting there when implementing a feature or fixing a bug.

    I hope this helps.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top