I am new to the XamScheduleView control and I have a requirement to display a bunch of appointments (activities in my domain) by resource (activity type).
The scenario is as follows:
1) User can select a broad Activity which filters the set of Activity Types
2) At this point, all Activity Types (resources) shall be visible in the Schedule View
3) User MAY choose to filter down to a specific Activity Type which then shows the one-and-only-one Activity Type (resource)
So I can dynamically bind my Activity Types to the ResourceItemsSource such that when I first select an Activity (top level filter), it's Activity Types (resources) render properly. However even to get this far, I have to hard-code a set of InitialCalendarIds with the IDs representing each Activity Type from my data store. I want this to be dynamic. As IntitialCalendarId is not a dependency property, I cannot bind a comma-separated list of IDs to it.
Secondly, when I subsequently change my Activity, my new set of Activity Types are not showing up on the Schedule View (all my resources from the previous Activity disappear correctly, but are not replaced with the new set of Activity Types (resources) from the new Activity). Additional info here, if I then go back and re-select the original Activity, the original Activity Types are no longer showing up either.
Is it possible to make my scenario work with your ScheduleView?
In my context, a Resource is an Activity Type which is filterable by a parent Activity. Appointments belong to an Activity Type.
Thanks.
Hello again,
I can suggest you change the DataConnector's ResourcetemSource, ResourceCalendarItemsSource, AppointmentItemsSource and TaskItemsSource, if you want to change the data in the XamScheduleView. By changing this collections run time, you will be abel to change the resources.
Hope this helps you.
Thanks Stefan,
My situation is not as trivial as the proposed suggestion. In my case, let us treat "Amanda" as one of potentially many resources. I do not know these at run-time. How do I dynamically add multiple Resources and have them render on XamScheduleView?
For example, Let's say I have a top level filter consisting of: MED, REC, WRK, and within these three, I have multiple "resources" such as MED1,MED2,MED3,REC1,REC2,etc.
When user selects "MED" via ComboBox, I want the ScheduleView to display MED1,MED2,MED3, and when REC is selected then display REC1,REC2,REC3, and so on and so forth.
Also, beforehand, I do not have access to the "InitialCalendarIDs". These are driven by our data store which can be changed on other admin screens.
In my case, I would probably use the PK of (MED1,MED2,MED3,REC1,REC2,etc) as the ResourceID. How do I have the ScheduleView display the selected set of Resources at runtime based on user selection of the parent category (MED for example).
Thanks
Hello,
Thank you for your post. I have been looking into it and I created a sample project for you that shows how to create and add Resources dynamically to the XamSchedule. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.