This is a migrated thread and some comments may be shown as answers.

Set RadDatePicker MinDate property from aspx

5 Answers 457 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
reguapo
Top achievements
Rank 1
reguapo asked on 09 May 2013, 08:17 PM
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

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 14 May 2013, 09:40 AM
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.
0
shubhangi
Top achievements
Rank 1
answered on 27 Aug 2015, 06:22 AM

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

0
shubhangi
Top achievements
Rank 1
answered on 27 Aug 2015, 06:24 AM

Called this also but not getting result

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

}

Thanks,

Shubhangi

 

0
shubhangi
Top achievements
Rank 1
answered on 27 Aug 2015, 06:58 AM

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

0
shubhangi
Top achievements
Rank 1
answered on 27 Aug 2015, 08:39 AM

It works..

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

Thanks,

Shubhangi

Tags
Calendar
Asked by
reguapo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
shubhangi
Top achievements
Rank 1
Share this question
or