how to change color of RadDatePicker

3 posts, 0 answers
  1. sathies
    sathies avatar
    37 posts
    Member since:
    Oct 2008

    Posted 08 Feb 2010 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Feb 2010 Link to this post

    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.
  3. sathies
    sathies avatar
    37 posts
    Member since:
    Oct 2008

    Posted 08 Feb 2010 Link to this post

    Hi Shinu,

    thanks, its works

    regards
    sathies
Back to Top