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

RadDatePicker for booking hotel - max date

6 Answers 84 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 22 Sep 2010, 01:13 PM
Hi

I have a raddatepicker for a hotel booking form
however, i want the calendar to only show from today onwards (upto 1 year)

How would i acheive this?
thanks

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Sep 2010, 01:39 PM
Hello Markus,


You could set the MinDate property of RadDatePicker from code behind as shown below.

Code:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadDatePicker1.MinDate = DateTime.Now.Date;
    }


-Shinu.
0
Cori
Top achievements
Rank 2
answered on 22 Sep 2010, 02:22 PM
To complete what Shinu posted, you would also set the MaxDate as well, since you mentioned you wanted it them to only select from today's date to up to one year. So it would look like this:

protected void Page_Load(object sender, EventArgs e)
    {
        RadDatePicker1.MinDate = DateTime.Today;
        RadDatePicker1.MaxDate = DateTime.Today.AddYears(1);
    }

I hope that helps.
0
Mark
Top achievements
Rank 1
answered on 27 Sep 2010, 12:34 PM
perfect thanks

dont suppose you know how to remove the week number column too?
0
Shinu
Top achievements
Rank 2
answered on 27 Sep 2010, 02:02 PM
Hi,

To remove week number column, set the ShowRowHeaders property to false.
 
Mark-up:
<telerik:RadDatePicker ID="DateIn" runat="server" Width="100px">
    <Calendar ShowRowHeaders="false">              
    </Calendar>
</telerik:RadDatePicker>


-Shinu.
0
Mark
Top achievements
Rank 1
answered on 12 Oct 2010, 08:42 AM
Thanks

sorry, one more question

the date being passed in on this

this

 

 

.uxArrivalDate.SelectedDate

 


is (as a url parameter)
08/10/2010%2000:00:00


how do i strip the time from this?
0
Dimo
Telerik team
answered on 15 Oct 2010, 08:03 AM
Hi Markus,

SelectedDate is a DateTime object, so it accepts and returns DateTime values. Depending on your requirements, you can strip or add time using standard ASP.NET methods, e.g. string operations, etc.

Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Calendar
Asked by
Mark
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Cori
Top achievements
Rank 2
Mark
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or