Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
305
How can i load a List<Object> in a ultraCalendarInfo
posted

Hi, i have a list of object and i want to load my appointments into ultraCalendarInfo. how can i do that?

 

my object : 

    public interface ICalendarAppointment

    {

        byte[] AllProperties { get; set; }

        DateTime StartDateTime { get; set; }

        DateTime EndDateTime { get; set; }

        string Subject { get; set; }

        bool AllDayEvent { get; set; }

        string OwnerKey { get; set; }

 

    }

 

And i want to Load a List< ICalendarAppointment > ,  i tried : 

ultraCalendarInfo.Appointments.GetAppointmentFromBindingListObject(mylist);

but doesn't work.

Many thanks

  • 69832
    Suggested Answer
    Offline posted

    You should probably use a BindingList<T> rather than a List<T>, since when data binding to the latter there will be no notifications when the contents change, which will cause you problems.

    Add the instances of the class that implements this ICalendarAppointment interface to a BindingList<T>, then assign that list to the UltraCalendarInfo.DataBindingsForAppointments.DataSource property. There are other properties that need to be set on the DataBindingsForAppointments; refer to the 'WinSchedule Database Demo' sample which is included with the SDK for direction.

    The reason GetAppointmentFromBindingListObject isn't working is that you are passing the list, when the method is expecting an object of the type that (in your case) implements this ICalendarAppointment interface.