I am trying to share an UltraCalendarInfo instance from and MDI parent form that I can then use from child forms so are all working with the same information. I have not been successful and your assistance is appreciated.
When I bind the calendar info on the MDI parent form to a datatable, the owners and appointments do not load. Afterwards I always end up with 1 owner (unassigned) and 0 appointments. I have checked my datatables and they have proper data in them. If i bind the same datatables to a calenderinfo on a child form, the owners and appointments load fine, so i'm confused why the instance on the MDI form will not.
Code on MDI form does not load owners and appoinments into calender info.
Private Sub MDIParent1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
DbConnector.CONNECTIONSTRING = mClientSettings.CONNECTIONSTRING
' loads owners and appointments into datatables
mClientSettings.DATATABLESCACHE.Load(mClientSettings.USER.ID)
' THE FOLLOWING LINE OF CODE DOES NOT LOAD ANY OWNERS AND APPOINTMENTS INTO THE CALENDAR INFO
' copy of code is below
BindHelper.BindCalendarInfo(Me.UltraCalendarInfo1)
'ShowNewForm(New frmDayView)
ShowNewForm(New frmAgendaView)
End Sub
frm.MdiParent = Me
frm.Show()
End Class
' THIS IS THE SAME CODE USED TO BIND THE DATATABLES TO THE CALENDAR INFO FOR BOTH THE MDI FORM AND CHILD FORMS
' WORKS FIND ON CHILD FORMS
' DOES NOT WORK ON MDI FORM
Public Shared Sub BindCalendarInfo(ByRef ci As Infragistics.Win.UltraWinSchedule.UltraCalendarInfo)
ci.Owners.UnassignedOwner.Visible = False
'
' owners
.DataSource = Nothing
.KeyMember = "id"
.NameMember = "username"
.EmailAddressMember = "email"
End With
' appointments
.DataKeyMember = "tempid"
.AllDayEventMember = "alldayflag"
.AllPropertiesMember = "allproperties"
.AllPropertiesMemberSerializationMode = Infragistics.Win.UltraWinSchedule.DateSerializationMode.SerializeDatesAsLocalTime
.DescriptionMember = "description"
.EndDateTimeMember = "date_end"
.OwnerKeyMember = "ownerid"
.ReminderEnabledMember = "reminder_enabled"
.ReminderIntervalMember = "reminder_interval"
.StartDateTimeMember = "date_start"
.SubjectMember = "subject"
' MY CODE ON THE CHILD FORMS
Me.UltraDayView1.CalendarLook = DirectCast(Me.MdiParent, MDIParent1).UltraCalendarLook1
' THE FOLLOWING COMMENTED LINE OF CODE WORKS FINE TO SHOW THE OWNERS AND APPOINTMENTS WHEN ON A CHILD FORM
'BindHelper.BindCalendarInfo(Me.UltraCalendarInfo1)
' THE FOLLOWING LINE OF CODE DOES NOT WORK, THE CALENDAR INFO INSTANCE FROM THE MDI FORM DOES NOT HAVE ANY APPOINTMENTS OR OWNERS
The data binding layer needs a binding context, so try setting the CalendarInfo.DataBindingsForAppointments.BindingContextControl property to reference the MDI parent.