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

ScheduleView & Dynamically defining readonly/special times?

4 Answers 113 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Jeffrey Hare
Top achievements
Rank 1
Jeffrey Hare asked on 28 Mar 2011, 04:13 AM
Hello,

  I have read this thread and this article and this seems much cleaner than with the RadScheduler.  I have this working reasonably well with RadScheduler.   I want to use ScheduleView for several other features.  

For Day and Week views, I want to style times of the day that are ReadOnly (unavailable for scheduling), but these are a function of the ITEM being scheduled and some equation related to the calendar date.   I don't think Resources are the answer since each item to be scheduled knows the size of the appointment slot it requires and can also compute the legal Start/End time ranges they can be schedule into for any specific calendar day.

With the RadScheduler, I bound the Free/BusySlotTemplate to a property that computed whether each slot being displayed was a free or busy slot. This changed slightly depending on which specific datagrid item was selected or being dragged onto the schedule. 

The function that computed free/busy style of the calendar slot is not related to the Day-of-week related.  Imagine the scheduling hours being related to something like Sunrise/Sunset which changes a little bit daily and that's a reasonably good analogy.

With ScheduleView, I'd like to achieve a similar thing, but am not quite sure how to do this efficiently since it seems to want me to define a collection of these things up front.  In addition, it seems I'd have to recompute this collection each time I selected something in the grid?  Since I don't know how far in the future/past the user may browse in the calendar, it would be too expensive to generate this collection for all possible days. 

[Side Note: I'm using MVVM-Lite ]
Any suggestions?
Thanks!

4 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 30 Mar 2011, 02:25 PM
Hi Jeffrey,

I am not sure that I understand you correctly, but if you are concerned only about the generation of the read-only slots for long periods of time you could use the VisibleRangeChanged event (or VisibleRangeChangedCommand) to generate read-only slots only for the visible days. The following example demonstrates how to use the aforementioned members to load appointments depending on the visible range, but I guess it should be enough to get you started:
http://demos.telerik.com/silverlight/#ScheduleView/LoadOnDemand

Please, let me know if you need additional information, or if I didn't understood your scenario.

Best wishes,
Valeri Hristov
the Telerik team
0
Jeffrey Hare
Top achievements
Rank 1
answered on 30 Mar 2011, 03:55 PM
Thanks Valeri,

Sorry I didn't explain it clearly enough.

[By the way, the demos you referred to seem much better than thoseI was looking at earlier. So, I'll study those some more.]

I attached a picture showing an example of Red for times that can't be scheduled (ReadOnly?). 

These Red times (can't create an appointment here) are computed based on the actual Day/Month/Year, not simply the Day of Week and so each week looks slightly different from the others.

When RadScheduler was rendering a view, it calls a method (prop) for each slot which applied an appropriate styling that indicates whether it was to be shown red or not.  The method simply computed whether the time fell within a ReadOnly timeframe or not and set the style appropriately.  I used a technique with TimeslotTemplateSelector to handle the job.  It wasn't super fast, but was ok. 

With ScheduleView,  It appears I should provide the start/end time ranges for the ReadOnly regions of each day visible (in Day or Week view).   So, I'm looking for a way to have ScheduleView request the ranges for the "day(s) it is going to render" so that I can compute what's available/not-available on a day by day basis for only the days being shown? ] 

Thanks!
-Jeff
0
Accepted
Valeri Hristov
Telerik team
answered on 01 Apr 2011, 04:25 PM
Hi Jeffrey,

Please, find attached a simple application that I created for you, demonstrating my first suggestion.

I hope it helps.

Kind regards,
Valeri Hristov
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
Jeffrey Hare
Top achievements
Rank 1
answered on 01 Apr 2011, 05:05 PM
Valeri,

   Perfect,  that's exactly what I was looking for!

Thank so much.
-Jeff
Tags
ScheduleView
Asked by
Jeffrey Hare
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Jeffrey Hare
Top achievements
Rank 1
Share this question
or