Rank: Administration
Medals: Groups: Administrators
Joined: 1/12/2010 Posts: 39 Points: 117
Thanks: 0 times Was thanked: 7 time(s) in 7 post(s)
|
At this point it is a little more than just doing that. We will mike it much simplier in a future release but currently you have to do it in code: Here's how you can load both appointments and resources via WCF RIA Services: This example uses bloggers as resources and blogger's articles as appointments: Code: private void LoadScheduler() { BlogManagerContext bmc = new BlogManagerContext();
//-- Map the minimal fields of the appointment class and create appointment DataAdapter. //-- If the source field names are the same, there is no need to map them. DataMapper mapperAppointment = new DataMapper(); mapperAppointment.Mapping.Add("Uid", "ArticleUid"); mapperAppointment.Mapping.Add("Start", "ArticleDate"); mapperAppointment.Mapping.Add("Finish", "ArticleDate"); mapperAppointment.Mapping.Add("ResourceUid", "BloggerUid"); mapperAppointment.Mapping.Add("Subject", "Headline"); multiScheduler.AppointmentDataAdapter = new RiaDataAdapter(bmc,bmc.FeaturedBloggerArticles,"GetFeaturedBloggerArticlesQuery",mapperAppointment); //--Map the minimal fields of the resource class and create resource DataAdapter //-- Note - If the source field names are the same, there is no need to map them. DataMapper mapperResources = new DataMapper(); mapperResources.Mapping.Add("Uid", "BloggerUid"); multiScheduler.ResourceDataAdapter = new RiaDataAdapter(bmc, bmc.FeaturedBloggers, "GetFeaturedBloggersQuery", mapperResources);
//-- Load the data - Load the appointments then the resources after the appointments are fully loaded. multiScheduler.AppointmentDataAdapter.DataLoaded += new EventHandler<EventArgs>(AppointmentDataAdapter_DataLoaded); multiScheduler.AppointmentDataAdapter.LoadData(); }
void AppointmentDataAdapter_DataLoaded(object sender, EventArgs e) { multiScheduler.ResourceDataAdapter.LoadData(); }
|