DevExpress XtraScheduler and BusinessListBase

DevExpress XtraScheduler and BusinessListBase

Old forum URL: forums.lhotka.net/forums/t/3572.aspx


kdlc posted on Thursday, September 20, 2007

Hi everyone,

I'm having a hell of a time trying to bind a BusinessListBase to the Scheduler Control!!
I've created a table using the structure defined on this KB from DevExpress:
http://www.devexpress.com/Support/Center/KB/p/A2951.aspx?searchtext
After that i'm using CodeSmith to create a EditableRootList + EditableRoot based on the table
but when i do run the application i dont get any appointments on the control, i'm binding the collection to a bindingsource control and the bindingsource control to the Storage Control ... but nothing, nada ... it's driving me nuts!!! any ideas on what i'm doing wrong???

any help would be appreciated it ...

Marcelo

SeVa replied on Thursday, September 20, 2007

Hope that helps:

private void InitSchedulerStorage(DevExpress.XtraScheduler.SchedulerStorage storage, object appointmentsDataSource, object resourcesDataSource, string id, string caption)
{
FilteredBindingList temporaryProfessionList = Professions.GetTemporaryProfessionList();
storage.Appointments.Labels.Clear();
foreach (Profession prof in temporaryProfessionList)
{
storage.Appointments.Labels.Add(new AppointmentLabel(Color.FromArgb(prof.Color), prof.Name, prof.Name));
}
storage.Appointments.AutoReload = false;
storage.Appointments.ResourceSharing = true;
storage.Appointments.CustomFieldMappings.Add(new DevExpress.XtraScheduler.AppointmentCustomFieldMapping("ObjectUid", "ObjectUid"));
storage.Appointments.CustomFieldMappings.Add(new DevExpress.XtraScheduler.AppointmentCustomFieldMapping("Quantity", "Quantity"));
storage.Appointments.DataSource = appointmentsDataSource;
storage.Appointments.Mappings.AllDay = "AllDay";
storage.Appointments.Mappings.Description = "Descr";
storage.Appointments.Mappings.End = "ToDate";
storage.Appointments.Mappings.Label = "Label";
storage.Appointments.Mappings.Location = "Location";
storage.Appointments.Mappings.RecurrenceInfo = "RecurrenceInfo";
storage.Appointments.Mappings.ReminderInfo = "ReminderInfo";
storage.Appointments.Mappings.ResourceId = "Resource";
storage.Appointments.Mappings.Start = "FromDate";
storage.Appointments.Mappings.Status = "Status";
storage.Appointments.Mappings.Subject = "Subject";
storage.Appointments.Mappings.Type = "ProfessionId";
storage.Appointments.Statuses.Clear();
storage.Appointments.Statuses.Add(new DevExpress.XtraScheduler.AppointmentStatus(DevExpress.XtraScheduler.AppointmentStatusType.Free, System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))), "По часам", "По &часам"));
storage.Appointments.Statuses.Add(new DevExpress.XtraScheduler.AppointmentStatus(DevExpress.XtraScheduler.AppointmentStatusType.Busy, System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255))))), "По дням", "По &дням"));
storage.Appointments.Statuses.Add(new DevExpress.XtraScheduler.AppointmentStatus(DevExpress.XtraScheduler.AppointmentStatusType.Custom, System.Drawing.Color.Fuchsia, "По посещениям", "По &посещениям"));
storage.Appointments.Statuses.Add(new DevExpress.XtraScheduler.AppointmentStatus(DevExpress.XtraScheduler.AppointmentStatusType.Tentative, System.Drawing.Color.Orange, "Сдельно", "&Сдельно"));
storage.Resources.DataSource = resourcesDataSource;
storage.Resources.Mappings.Caption = caption;
storage.Resources.Mappings.Id = id;
}

kdlc replied on Friday, September 21, 2007

Just for the record, the problem was the Resources Data source on the Control, if no resources mapped to the control, the control doesnt display any data ... :(

 

RedShiftZ replied on Monday, May 04, 2009

kdlc:

Hi everyone,

I'm having a hell of a time trying to bind a BusinessListBase to the Scheduler Control!!
I've created a table using the structure defined on this KB from DevExpress:
http://www.devexpress.com/Support/Center/KB/p/A2951.aspx?searchtext
After that i'm using CodeSmith to create a EditableRootList + EditableRoot based on the table
but when i do run the application i dont get any appointments on the control, i'm binding the collection to a bindingsource control and the bindingsource control to the Storage Control ... but nothing, nada ... it's driving me nuts!!! any ideas on what i'm doing wrong???

any help would be appreciated it ...

Marcelo



Any chance you would share the basics of this code? I am trying to do the same for our appointment system. DevExpress gives a business object example, but I cannot seem to shoehorn it into the CSLA objects.

Thanks,

Jeff

Copyright (c) Marimer LLC