RadDatePicker for booking hotel - max date

7 posts, 0 answers
  1. Mark
    Mark avatar
    17 posts
    Member since:
    Feb 2010

    Posted 22 Sep 2010 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Sep 2010 Link to this post

    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.
  3. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 22 Sep 2010 Link to this post

    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.
  4. Mark
    Mark avatar
    17 posts
    Member since:
    Feb 2010

    Posted 27 Sep 2010 Link to this post

    perfect thanks

    dont suppose you know how to remove the week number column too?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Sep 2010 Link to this post

    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.
  6. Mark
    Mark avatar
    17 posts
    Member since:
    Feb 2010

    Posted 12 Oct 2010 Link to this post

    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?
  7. Dimo
    Admin
    Dimo avatar
    8471 posts

    Posted 15 Oct 2010 Link to this post

    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
Back to Top