DatePicker with Label at runtime

4 posts, 0 answers
  1. Luiz
    Luiz avatar
    15 posts
    Member since:
    Nov 2010

    Posted 29 Nov 2010 Link to this post


    I didn't find Label property for DatePicker.
    How can I do to appears Label, TextBox to input date and Button for calendar (with at runtime)?


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Nov 2010 Link to this post


    I read from some forums that the DatePicker rendering does not allow adding the built-in RadInput label and hence you can use standard ASP:Label control instead.

    Here are the related forums:
    RadDatePicker and Label
    RadDatePicker and AssociatedControlID

  3. Luiz
    Luiz avatar
    15 posts
    Member since:
    Nov 2010

    Posted 29 Nov 2010 Link to this post


    Tks for your reply.
    I thought to put a ASP label before DatePicker, but how can I handle the theme behavior? Is it working with ASP Label also?

    See ya

  4. Dimo
    Dimo avatar
    8456 posts

    Posted 30 Nov 2010 Link to this post

    Hi Luiz,

    RadControls styles will not be applied to an external <label> element automatically. However, you have two options:

    1) Use RadFormDecorator to style (decorate) label elements.


    2) Apply some RadControls CSS classes to the external label and its wrapper:

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <head runat="server">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <label for="RadDatePicker1_dateInput_text">default label</label>
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" />
    <br /><br /><br />
    <span class="RadInput RadInput_Default"><label class="riLabel" for="RadDatePicker2_dateInput_text">styled label</label></span>
    <telerik:RadDatePicker ID="RadDatePicker2" runat="server" />

    Kind regards,
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top