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

Cannt change CSS Class of RadNumeric

1 Answer 74 Views
Input
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 30 Dec 2013, 08:56 AM

In the design time, I set the CssClass property to "red"

After some event, I try to set it to "yellow", but it doesn't work.



I tried:

TxtAmount.CssClass = "yellow";

Also

TxtAmount.CssClass += TxtAmount.CssClass.Replace("red", "yellow");

plus other ways








1 Answer, 1 is accepted

Sort by
0
A2H
Top achievements
Rank 1
answered on 30 Dec 2013, 07:01 PM
Hi,
Try with the below implementation
1) Add the below css style to your page
<style type="text/css">
       .redradnumTxtbox
       {
         background-color:Red !important;
       }
        
       .yellowradnumTxtbox
       {
         background-color:Yellow !important;
       }
   </style>
Change the css styles as per your requirement

Then apply the 'redradnumTxtbox'  to textbox MarkUp like given below
<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" CssClass="redradnumTxtbox" >
       </telerik:RadNumericTextBox>
 
After this you can change the css class of numeric textbox on button click like given below
protected void Button5_Click(object sender, EventArgs e)
    {
        //Do your task here
 
        //Set the css class of RadNumeric Textbox
        RadNumericTextBox1.CssClass = "yellowradnumTxtbox";
    }

Hope this helps.
Tags
Input
Asked by
Mohamed
Top achievements
Rank 1
Answers by
A2H
Top achievements
Rank 1
Share this question
or