Function to change backgroundcolor on datetimepicker on selected date change

2 posts, 0 answers
  1. Bill
    Bill avatar
    96 posts
    Member since:
    Aug 2006

    Posted 14 Nov 2013 Link to this post

    I have a radtextbox that I have set to change the background color on change text:
    <ClientEvents OnValueChanged="ChangeBackColor" />
    function ChangeBackColor(sender) {
    sender.get_styles().EnabledStyle[0] += "background-color: lemonchiffon;";
    sender.updateCssClass(); }

    I have a combobox that does the same thing:


    function ChangeBackColorCombo(sender, args) {
    var inputElement = sender.get_inputDomElement(); = "lemonchiffon";

    Is there an equvalent to this for a datetime picker? I cant find the function that reference the input or textbox of the control to change it on a selected date change.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Nov 2013 Link to this post

    Hi Bill,

    Please have a look into the code snippet to change the background color of RadDatePicker.

    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
        <DateInput ClientEvents-OnValueChanged="ValueChanged">

    <script type="text/javascript">
        function ValueChanged(sender, args) {
            sender.get_styles().EnabledStyle[0] += "background-color: red;";

Back to Top