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

Set the font color in Rad Numeric Textbox in Code-behind

2 Answers 296 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 14 Jan 2014, 06:12 PM
What is the correct way to set the font color of a RAD Numeric textbox in the code-behind? I have a CSS Class set up and tried the .WrapperCssClass attrubute but the color did not change. I would like to change the color to red if the value is negative.

Thanks,

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 15 Jan 2014, 02:50 AM
Hi Dave,

Please have a look into the following C# code snippet to change the font color of RadNumericTextBox.

C#:
protected void RadNumericTextBox1_TextChanged(object sender, EventArgs e)
{
    if (Convert.ToInt16(RadNumericTextBox1.Text)<0)
    {
        RadNumericTextBox1.Style.Add("color ", "Red");
    }
}

Thanks,
Shinu.
0
Dave
Top achievements
Rank 1
answered on 15 Jan 2014, 03:51 AM
Yes, perfect. Thank you.
Tags
General Discussions
Asked by
Dave
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dave
Top achievements
Rank 1
Share this question
or