Styling reservation system

8 posts, 0 answers
  1. Nic
    Nic avatar
    32 posts
    Member since:
    Oct 2008

    Posted 26 Apr 2010 Link to this post

    Hi there,

    I would like to demo a rental reservation system using the calendar control. The reservation is modelled like a hotel room in which the outgoing guest checks out by 11am, and the incoming guest can have the room after 1pm.

    I'd like to display this on the calendar using a background shading. If we imaging each day as a square then:

    • start day = right half shaded to indicate latter part of day booked
    • intermediate days = full shading
    • last day = left half shaded to indicated first half od day booked

    Could you explain how to do this?

    Thanks!

  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 29 Apr 2010 Link to this post

    Hi Nic,

    My recommendation is to use the DayTemplateSelector or DayButtonStyleSelector that will get the correct style or template. Check the example for more information.

    All the best,
    Kaloyan
    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.
  3. DevCraft banner
  4. Nic
    Nic avatar
    32 posts
    Member since:
    Oct 2008

    Posted 04 May 2010 Link to this post

    Hi Kaloyan,

    I followed the example using the DayTemplateSelector but am unsure how to proceed for these reasons:

    1. On loading, I'd like to supply a list of dates. I'm not sure how to make the template selection work against the dates provided.
    2. I'd like to make it interactive so the user can select a date range by dragging on the calendar and I'd template as I mentioned above.

    Thanks,
    Nic


  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 10 May 2010 Link to this post

    Hi Nic,

    As a solution is to provide a static collection of datetimes object that will contain the desire dates. So the collection will be accessible form the DayTemplateSelector. It is not possible to retemplate the control after the date selection of the calendar. This is a limitation of the current version of the control that will be fixed in some of the upcoming internal builds.

    Regards,
    Kaloyan
    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.
  6. Nic
    Nic avatar
    32 posts
    Member since:
    Oct 2008

    Posted 10 May 2010 Link to this post

    Hi Kaloyan,

    I'd like to provide a list of dates determined at run-time. Is that possible and could you provide sample code?

    The second thing - I see that the calendar control allows the user to select a range of days which is then highlighted. Could I somehow use this highlighting logic programmatically to do what I described above?

    Tanks,
    Nic

  7. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 13 May 2010 Link to this post

    Hello Nic,

    You can programmatically select a date by adding a dates into the SelectedDates collection property. Check the code snippet bellow:

    calendar.SelectedDates.Add(DateTime.Now.AddDays(1));
    calendar.SelectedDates.Add(DateTime.Now.AddDays(2));
    calendar.SelectedDates.Add(DateTime.Now.AddDays(3));
    calendar.SelectedDates.Add(DateTime.Now.AddDays(4));

    Greetings,
    Kaloyan
    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.
  8. Kowal
    Kowal avatar
    14 posts
    Member since:
    Apr 2010

    Posted 19 Jun 2010 Link to this post

    Hi Kaloyan,

    Could you please give PITS issue ID for "retemplating the control after the date selection of the calendar" so I can check when this feature gets implemented. It's a really important feature for my business application.

    Edit:
    I would also like to know why SelectedDates property is not a DependencyProperty (in contrary to SelectedDate property), which forces me to use codebehind to handle selection changes instead of a ViewModel (binding).

    Thanks,
    Kowal
  9. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 21 Jun 2010 Link to this post

    Hi Kowal,

    The task is logged. The ID is 2486. Also the SelectedDates property is a DependencyProperty but it is readonly that is why there is no possibility to expose a binding to it. This is a recommendation by the WPF team. You can create a custom attached property that will set the collection, in case you want to bind to it through XAML.

    Best wishes,
    Kaloyan
    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
DevCraft banner