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

Label Color

3 Answers 787 Views
Input
This is a migrated thread and some comments may be shown as answers.
SDI
Top achievements
Rank 1
SDI asked on 02 May 2013, 08:56 PM
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?

Thanks!
Brian

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 May 2013, 05:08 AM
Hi,

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.
C#
RadTextBox1.LabelCssClass = "MyLabelStyle";
CSS:
.RadInput_Skinname .MyLabelStyle.riLabel
     {
         font-weight:bolder !important;
         color:Blue !important;
     }

Thanks,
Shinu
0
SDI
Top achievements
Rank 1
answered on 03 May 2013, 12:31 PM
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.
0
Accepted
Venelin
Telerik team
answered on 07 May 2013, 01:21 PM
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.

Greetings,
Venelin
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.
Tags
Input
Asked by
SDI
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
SDI
Top achievements
Rank 1
Venelin
Telerik team
Share this question
or