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

how to change color of RadDatePicker

2 Answers 215 Views
Input
This is a migrated thread and some comments may be shown as answers.
sathies
Top achievements
Rank 1
sathies asked on 08 Feb 2010, 09:26 AM
Hi,
    I have a checkbox and  RadDatePicker . I want to change color of RadDatePicker on checkchanged event of checkbox.
ie)when the value of checkbox is true the color of  RadDatePicker datainput should be yellow and when false the color should be white


regards
sathies

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Feb 2010, 10:55 AM
Hello Sathies,

The following code shows how to implement the desired approach from client side.

aspx:
 
<telerik:RadDatePicker ID="RadDatePicker13" runat="server"
</telerik:RadDatePicker> 
<asp:CheckBox ID="CheckBox1" runat="server" onclick="checkedChanged(this);" /> 

javascript:
 
    function checkedChanged(checkbox) { 
        var datepicker = $find("<%=RadDatePicker13.ClientID%>"); 
        if (checkbox.checked) { 
            datepicker.get_dateInput()._textBoxElement.style.backgroundColor = "yellow"
        } 
        else { 
            datepicker.get_dateInput()._textBoxElement.style.backgroundColor = "white"
        } 
    } 

-Shinu.
0
sathies
Top achievements
Rank 1
answered on 08 Feb 2010, 12:25 PM
Hi Shinu,

thanks, its works

regards
sathies
Tags
Input
Asked by
sathies
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
sathies
Top achievements
Rank 1
Share this question
or