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
25
AllProperties and Business Classes
posted

I am working on a windows form project and I want to use the AllProperties property from the CalendarInfo.DataBindingsForAppointments class. I have not been able to find a single code example of how this will work using the business classes and not data sets.

My boss has asked me to use business classes and not datasets so I don't have the option to use datasets.

Can someone please post an example or point me in the direction of an example?

Thank you.

  • 1922
    posted

    Hi, I use the following code to setup my binding:

    ---------------------------------------------------------------------------------------------------------------------------------------------

     appointmentBindingSource.DataSource = appointmentList;

    ultraCalendarInfo.DataBindingsForAppointments.AllPropertiesMember = "AllProperties";

    ultraCalendarInfo.DataBindingsForAppointments.StartDateTimeMember = "StartDateTime";

    ultraCalendarInfo.DataBindingsForAppointments.EndDateTimeMember = "EndDateTime";

    ultraCalendarInfo.DataBindingsForAppointments.SubjectMember = "Subject";

    ultraCalendarInfo.DataBindingsForAppointments.AllDayEventMember = "IsAllDayEvent";

    ultraCalendarInfo.DataBindingsForAppointments.OwnerKeyMember = "OwnerKey";

    ultraCalendarInfo.DataBindingsForAppointments.SetDataBinding(appointmentBindingSource, string.Empty);

    this.ultraCalendarInfo.DataBindingsForAppointments.BindingContextControl = this;

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

     appointmentList is a BindingList<T> where T is  an AppointmentVO.

    The AppointmentVO is defined as follows:

    public class AppointmentVO

    {

     

    private int appointmentIdField = int.MinValue;

    /// <summary>

    /// Gets or sets the appointment ID.

    /// </summary>

    /// <value>The appointment ID.</value>

    public int AppointmentId

    {

    get { return appointmentIdField; }set { appointmentIdField = value; }

    }

     

    private bool isNewField = true;

    /// <summary>

    /// Gets or sets a value indicating whether this instance is new. The value is false if the VO has been loaded from the DB.

    /// </summary>

    /// <value><c>true</c> if this instance is new; otherwise, <c>false</c>.</value>

    public bool IsNew

    {

    get { return isNewField; }set { isNewField = value; }

    }

     

    private string ownerKeyField = string.Empty;

     

    /// <summary>

    /// Gets or sets the owner key.

    /// </summary>

    /// <value>The owner key.</value>

    public string OwnerKey

    {

    get { return ownerKeyField; }set { ownerKeyField = value; }

    }

     

    private byte[ allPropertiesField = new byte[1];public byte[ AllProperties

    {

    get { return allPropertiesField; }

    set { allPropertiesField = value; }

    }

    private string subjectField = string.Empty;

    /// <summary>

    /// Gets or sets the subject.

    /// </summary>

    /// <value>The subject.</value>

    public string Subject

    {

    get { return subjectField; }set { subjectField = value; }

    }

    private bool isAllDayEvent;

    /// <summary>

    /// Gets or sets a value indicating whether this instance is an all day event.

    /// </summary>

    /// <value>

    /// <c>true</c> if this instance is an all day event; otherwise, <c>false</c>.

    /// </value>

    public bool IsAllDayEvent

    {

    get { return isAllDayEvent; }set { isAllDayEvent = value; }

    }

    private DateTime startDateTimeField = DateTime.MinValue;

    /// <summary>

    /// Gets or sets the start date time.

    /// </summary>

    /// <value>The start date time.</value>

    public DateTime StartDateTime

    {

    get { return startDateTimeField; }set { startDateTimeField = value; }

    }

     

     

    private DateTime endDateTimeField = DateTime.MinValue;

    /// <summary>

    /// Gets or sets the end date time.

    /// </summary>

    /// <value>The end date time.</value>

    public DateTime EndDateTime

    {

    get { return endDateTimeField; }set { endDateTimeField = value; }

    }

    }

    ----------------

     

    hope this helps!