Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Clear the Owners collection
Me.UltraDayView1.CalendarInfo.Owners.Clear()
' Hide the unassigned owner
Me.UltraDayView1.CalendarInfo.Owners.UnassignedOwner.Visible = False
' Add 2 owners
Dim ownerFrick As Infragistics.Win.UltraWinSchedule.Owner = Me.UltraDayView1.CalendarInfo.Owners.Add("frick", "Frick")
Dim ownerFrack As Infragistics.Win.UltraWinSchedule.Owner = Me.UltraDayView1.CalendarInfo.Owners.Add("frack", "Frack")
' Add an appointment for "Frick"
Dim appointmentFrick As Appointment = Me.UltraCalendarInfo1.Appointments.Add(DateTime.Today, "Frick's Appointment")
appointmentFrick.Owner = ownerFrick
' Add an appointment for "Frack"
Dim appointmentFrack As Appointment = Me.UltraCalendarInfo1.Appointments.Add(DateTime.Today, "Frack's Appointment")
appointmentFrack.Owner = ownerFrack
' Use the SwapIndex method to swap positions for the 2 owners
ownerFrick.SwapIndex(ownerFrack)
' Use the ReassignAllActivity method to assign all of "Frick's" activity to "Frack"
ownerFrick.ReassignAllActivity(ownerFrack)
End Sub