This question is locked. New answers and comments are not allowed.
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:
Could you explain how to do this?
Thanks!
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!
7 Answers, 1 is accepted
0
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.
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.
0
Nic
Top achievements
Rank 1
answered on 04 May 2010, 01:58 PM
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
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
0
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.
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.
0
Nic
Top achievements
Rank 1
answered on 10 May 2010, 08:26 PM
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
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
0
Hello Nic,
You can programmatically select a date by adding a dates into the SelectedDates collection property. Check the code snippet bellow:
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.
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.
0
Kowal
Top achievements
Rank 1
answered on 19 Jun 2010, 01:45 PM
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
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
0
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
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