Create RadDatePicker Dynamically

3 posts, 0 answers
  1. Mauricio
    Mauricio avatar
    5 posts
    Member since:
    Apr 2013

    Posted 13 May 2013 Link to this post

    Hi, I need help with an issue, I cannot find the way to create RadDatePicker dynamically of C#, can you help me with this please.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 May 2013 Link to this post

    Hi Mauricio,

    Please have a look at the sample code I tried which works fine at my end.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" Text="Create RadDatePicker in C#"
        OnClick="RadButton1_Click">
    </telerik:RadButton>
    <br /><br />

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        Telerik.Web.UI.RadDatePicker radDatePicker1 = new Telerik.Web.UI.RadDatePicker();
        radDatePicker1.ID = "RadDatePicker1";
        radDatePicker1.Width = 300;
        radDatePicker1.Calendar.RangeMinDate = System.DateTime.Today;
        radDatePicker1.DateInput.EmptyMessage = "Select Date";
        this.form1.Controls.Add(radDatePicker1);
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mauricio
    Mauricio avatar
    5 posts
    Member since:
    Apr 2013

    Posted 14 May 2013 Link to this post

    Oh, your really help me a lot, thanks
Back to Top