Using RadDateTimePicker Without a TABLE Wrapping the TextBox and Popup Buttons

Thread is closed for posting
1 posts, 1 answers
  1. Answer
    Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 01 Jul 2010 Link to this post

    Requirements

    RadControls for ASP .NET AJAX version

    2009.1. and later
    .NET version

    all
    Visual Studio version

    all
    programming language

    all
    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    The following code snippet demonstrates how to use a RadDateTimePicker without a <table> wrapping the textbox and popup buttons. Such an HTML rendering may be required by developers that like to conform strictly to HTML/CSS standards and best practices.

    <%@ Page Language="C#" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
      
    <script runat="server"
      
    protected void PickerButtons_PreRender(object sender, EventArgs e) 
        (sender as Panel).CssClass = String.Format("RadPicker RadPicker_{0}", RadDateTimePicker1.Skin); 
      
    </script> 
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
      
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
    <meta http-equiv="content-type" content="text/html;charset=utf-8" /> 
    <title>RadControls</title> 
    </head> 
    <body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
     
    <telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server" style="float:left"
        <DatePopupButton Visible="false" /> 
        <TimePopupButton Visible="false" /> 
    </telerik:RadDateTimePicker> 
      
    <asp:Panel ID="PickerButtons" runat="server" OnPreRender="PickerButtons_PreRender" style="display:inline"
            <href="#" class="rcCalPopup" onclick="return showCal()" style="float:left">open Calendar popup</a> 
            <href="#" class="rcTimePopup" onclick="return showTime()" style="float:left">open TimeView popup</a> 
    </asp:Panel> 
     
    <div style="clear:both"><!-- --></div
     
    <script type="text/javascript"
      
    function showCal() 
        $find("<%= RadDateTimePicker1.ClientID %>").showPopup(); 
        return false; 
      
    function showTime() 
        $find("<%= RadDateTimePicker1.ClientID %>").showTimePopup(); 
        return false; 
      
    </script> 
      
    </form> 
    </body> 
    </html> 
Back to Top