DatePicker with Label at runtime VB.net

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

    Posted 29 Nov 2010 Link to this post

    Hi,

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

    Tks

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

    Posted 29 Nov 2010 Link to this post

    Hello,


    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


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

    Posted 29 Nov 2010 Link to this post

    Shinu,

    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

    Luiz
  4. Dimo
    Admin
    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.

    or

    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" />
    <title>RadControls</title>
    </head>
    <body>
    <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" />
     
    </form>
    </body>
    </html>


    Kind regards,
    Dimo
    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