• Working with Multiple Appointment Owners in a Schedule control [Janus GridEX WinForms Control v3.5 for .NET]

    This tutorial is intended to show how to handle appointments for more than one person.



    1) Create a new "Windows Application" Project.



    2) Drag a Schedule control from the toolbox into the Form designer.



    3) Select the Schedule control in the Form and set the MultiOwner property to true in the properties window.



    4) Right click in the Schedule control and select "Schedule Designer" menu. In the Schedule Designer dialog select Owners node.



    5) In the Owners panel, Click Add button to add a new owner. Select the new owner and set the following properties in the properties window.

    Text = John Doe

    Value = Doe



    6) Add another owner with the following properties values.

    Text = Peter Barker

    Value = Barker



    Note: In design time the Value property of the ScheduleAppointmentOwner can only be a string. Set the Value in code if you want a different type.



    7) In code create two appointments and add them to the Schedule control.



    In C#



    DateTime startDate = this.schedule1.Date.AddHours(8);



    ScheduleAppointment app1 = new ScheduleAppointment(startDate, startDate.AddMinutes(30), "Phone Call");

    ScheduleAppointment app2 = new ScheduleAppointment(startDate, startDate.AddMinutes(30), "Go to the dentist");



    //The Owner property of the Appointment must be equal to the Value property of //one of the AppointmentOwners in the Schedule control.

    app1.Owner = "Doe";

    app2.Owner = "Barker";



    this .schedule1.Appointments.Add(app1);

    this .schedule1.Appointments.Add(app2);





    In VB



    Dim startDate As DateTime = Me.Schedule1.Date.AddHours(8)



    Dim app1 As ScheduleAppointment = New ScheduleAppointment(startDate, startDate.AddMinutes(30), "Phone Call")

    Dim app2 As ScheduleAppointment = New ScheduleAppointment(startDate, startDate.AddMinutes(30), "Go to the dentist")



    'The Owner property of the Appointment must be equal to the Value property of

    'one of the AppointmentOwners in the Schedule control.

    app1.Owner = "Doe"

    app2.Owner = "Barker"



    Me.Schedule1.Appointments.Add(app1)

    Me.Schedule1.Appointments.Add(app2)



    8) Press F5 and run the project.

    Source Of Information : Janus v3.5 Help Files for VS 2008