Set RadDatePicker MinDate property from aspx

6 posts, 0 answers
  1. reguapo
    reguapo avatar
    16 posts
    Member since:
    Jul 2009

    Posted 09 May 2013 Link to this post

    I am trying to set the mindate property of the raddatepicker in the aspx file:

    <telerik:RadDatePicker ID="RadDateEffectiveDate" runat="server"
    Culture="English (United States)"  MinDate="<%# DateTime.Today.Date %>">
    </telerik:RadDatePicker>

    but didn't work, any suggestions??

    I actually ended setting the mindate in the code behind but I thought that I could do it this way
    RadDateEffectiveDate.MinDate = DateTime.Today
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 May 2013 Link to this post

    Hi Reguapo,

    Try the following.
    ASPX:
    <telerik:RadDatePicker ID="RadDateEffectiveDate" runat="server" Culture="English (United States)" MinDate="<%# DateTime.Today.Date %>">
    </telerik:RadDatePicker>

    When using a databinding expression such as <%# DateTime.Today.Date %>, then you have to call Page.DataBind() (or ltrDate.DataBind() if that's the only databound control) from your code-behind (e.g. in Page_Load).

    C#:
    protected void Page_Load(object sender, EventArgs e)
      {
          Page.DataBind();
      }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. shubhangi
    shubhangi avatar
    19 posts
    Member since:
    Aug 2015

    Posted 27 Aug 2015 in reply to reguapo Link to this post

    Hi Princy,

    I am trying to set the mindate and DateInput-MinDate property of the raddatepicker.

     <telerik:RadDateTimePicker ID="StartInput" DateInput-MinDate="<%# DateTime.Today.Date %>" SelectedDate='<%# Bind("Start") %>' runat="server">
                                            <Calendar ShowRowHeaders="false" runat="server"></Calendar>
                                        </telerik:RadDateTimePicker>

    But, Not getting ..any other idea??

     

    Thanks,

    Shubhangi

  5. shubhangi
    shubhangi avatar
    19 posts
    Member since:
    Aug 2015

    Posted 27 Aug 2015 in reply to shubhangi Link to this post

    Called this also but not getting result

     protected void Page_Load(object sender, EventArgs e)
            {
                Page.DataBind();

    }

    Thanks,

    Shubhangi

     

  6. shubhangi
    shubhangi avatar
    19 posts
    Member since:
    Aug 2015

    Posted 27 Aug 2015 in reply to shubhangi Link to this post

    Hi princy,

    This code is working fine for date picker..

     <telerik:RadDateTimePicker ID="StartInput" SelectedDate='<%# Bind("Start") %>' runat="server">
    <Calendar ShowRowHeaders="false" RangeMinDate="<%# DateTime.Now %>" runat="server"></Calendar>
    </telerik:RadDateTimePicker>​

    After, I want the same for Time picker..do you have any idea..

     

    Thanks,

    Shubhangi

  7. shubhangi
    shubhangi avatar
    19 posts
    Member since:
    Aug 2015

    Posted 27 Aug 2015 in reply to reguapo Link to this post

    It works..

    <telerik:RadDateTimePicker ID="StartInput" SelectedDate='<%# Bind("Start") %>' runat="server">
    <Calendar ShowRowHeaders="false" RangeMinDate="<%# DateTime.Now %>" runat="server"></Calendar>
    </telerik:RadDateTimePicker>​

    Thanks,

    Shubhangi

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017