I found the following article for mapping my datasource to the scheduler control.
I'm having the following problem.
I mapped every single property for the appointment collection [See code below] also In my model view I added collections for ResourceItems and Calendars and i instantiate them in my init method in my model view [See code below]. I added for my event items an OwningResourceId and an OwiningCalendarId that return the intance ids from my initialized method.
WWhen I run I keep getting the following error:
'Collection property 'Infragistics.Controls.Schedules.ListScheduleDataConnector'.'AppointmentPropertyMappings' is null.'
When I add an appointments class and a collection in my model view and dump my event values directly then everything works...my problem is that I have properties in my custom business object that i want to utilize to customize the scheduler data presenter template....I tried to add the fields i needed into the Appointment class and dump my needed field values so that I could use them when customizing the template but they don't seem to be picked up at all... how do i handle this problem?
var Apps2 = EventCollection.Select(r => new Appointment { Id = r.EventId.ToString(), Start = r.EventStartDate.GetValueOrDefault(Convert.ToDateTime(r.EventDate)), End = r.EventEndDate.GetValueOrDefault(Convert.ToDateTime(r.EventDate)), OwningCalendarId = "cal0", OwningResourceId = "res0", Subject = r.EventName, Description = r.EventNotes, IsTimeZoneNeutral = true, FightCount = r.FightCount, HasTitleFight = r.HasTitleFight }); foreach (var App in Apps2) Appointments.Add(App);
----------------------------------------------
MY XAML
___________________________
<ig:ListScheduleDataConnector AppointmentItemsSource="{Binding EventDataCardCollection}" ResourceItemsSource="{Binding ResourceItems}" ResourceCalendarItemsSource="{Binding Calendars}"> <ig:ListScheduleDataConnector.AppointmentPropertyMappings> <ig:AppointmentPropertyMapping AppointmentProperty="Id" DataObjectProperty="EventId" /> <ig:AppointmentPropertyMapping AppointmentProperty="Start" DataObjectProperty="EventStartDate" /> <ig:AppointmentPropertyMapping AppointmentProperty="End" DataObjectProperty="EventEndDate" /> <ig:AppointmentPropertyMapping AppointmentProperty="OwningResourceId" DataObjectProperty="OwningResourceId" /> <ig:AppointmentPropertyMapping AppointmentProperty="OwningCalendarId" DataObjectProperty="OwningCalendarId" /> <ig:AppointmentPropertyMapping AppointmentProperty="Subject" DataObjectProperty="EventName" /> <ig:AppointmentPropertyMapping AppointmentProperty="Description" DataObjectProperty="EventNotes" /> </ig:ListScheduleDataConnector.AppointmentPropertyMappings> <ig:ListScheduleDataConnector.ResourceCalendarPropertyMappings> <ig:ResourceCalendarPropertyMappingCollection UseDefaultMappings="True"></ig:ResourceCalendarPropertyMappingCollection> </ig:ListScheduleDataConnector.ResourceCalendarPropertyMappings> <ig:ListScheduleDataConnector.ResourcePropertyMappings> <ig:ResourcePropertyMappingCollection UseDefaultMappings="True"> </ig:ResourcePropertyMappingCollection> </ig:ListScheduleDataConnector.ResourcePropertyMappings> </ig:ListScheduleDataConnector>
_________________________________________________
MODEL VIEW
________________________________________________
public void Initialize() { ResourceItems = new ObservableCollection<Resource>(); ResourceItems.Add(new Resource() { Id = "res0" }); Calendars = new ObservableCollection<ResourceCalendar>(); Calendars.Add(new ResourceCalendar() { Id = "cal0", OwningResourceId = "res0" }); EventCollection = GoGetMyEventCollection();
}
http://help.infragistics.com/Help/NetAdvantage/WPF/2011.1/CLR4.0/html/xamSchedule_Using_Connector_Mapping.html
Hello,
I apologize for the confusion but we had an issue in the documentation that was fixed in version 2011.2. You have to explicitly define the AppointmentPropertyMappingCollection and then put the AppointmentPropertyMapping(s) in it. Here is the link to the same topic in the 2011.2 documentation:
http://help.infragistics.com/Help/NetAdvantage/WPF/2011.2/CLR4.0/html/xamSchedule_Using_Connector_Mapping.html
Let me know if you need any further assistance.
Thanks,
Diyan Dimitrov