Setting width and height for RadDatePicker in Javascript

2 posts, 1 answers
  1. Mark
    Mark avatar
    97 posts
    Member since:
    Nov 2007

    Posted 01 Dec 2008 Link to this post

    Hi

    I am using currently using Telerik controls 2008.2.826.35.

    Is there a way to use Javascript to set the width and the height of a RadDatePicker?

    I read the documentation but there doesn't seem to be any set_width() and set_height() methods.


    Kind regards

    Mark Eaton
  2. Answer
    Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 02 Dec 2008 Link to this post

    Hello Mark,

    You can set the width/height of the nested DateInput element:
    <input type="button" value="Resize" onclick="ChangeSize()" /> 
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
    </telerik:RadDatePicker> 

    <script type="text/javascript" language="javascript"
        function ChangeSize() 
        { 
            var picker = $find('<%= RadDatePicker1.ClientID %>'); 
            picker.get_dateInput()._originalTextBoxCssText = "width: 300px; height: 80px;"
            picker.get_dateInput().updateCssClass(); 
        } 
    </script> 

    Let me know whether this helps.

    Regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top