Hello Steve,
Thank you for writing.
You are correct that you are not able to set the MasterEvent of the occurrence. The reason is that the field and the property MasterEvent is called with the same name (field name is 'masterEvent', property name is 'MasterEvent'). VB.Net is not case sensitive and it finds only the property so you are not able to see the field. If you want to set this property, you should to use reflection in order to set the field value.
Public
Class
CustomAppointment
inherits Appointment
''' <summary>
''' ... for repeated occurrences
''' </summary>
''' <param name="start"></param>
''' <returns></returns>
Public
Overrides
Function
CreateOccurrence(
ByVal
start
As
Date
)
As
IEvent
Dim
occurrence
As
CustomAppointment =
New
CustomAppointment
occurrence.Start = start
occurrence.Duration =
Me
.Duration
occurrence.RecurrenceRule =
Nothing
occurrence.Summary =
Me
.Summary
occurrence.Description =
Me
.Description
occurrence.Location =
Me
.Location
occurrence.ToolTipText =
Me
.ToolTipText
occurrence.Visible =
Me
.Visible
occurrence.AllowDelete =
Me
.AllowDelete
occurrence.AllowEdit =
Me
.AllowEdit
For
each id as EventId in
Me
.ResourceIds
occurrence.ResourceIds.Add(id)
Next
occurrence.BackgroundId =
Me
.BackgroundId
occurrence.StatusId =
Me
.StatusId
occurrence.CultureInfoProvider =
Me
.CultureInfoProvider
occurrence.IsViewCalculated =
True
dim appType as Type =
GetType
(Telerik.WinControls.UI.Appointment)
appType.GetField(
"masterEvent"
, system.reflection.bindingFlags.Instance or system.reflection.bindingFlags.NonPublic).SetValue(occurrence, me)
Return
occurrence
End
Function
End
Class
In case that you have other related questions, do not hesitate to write back.
All the best,
Dobry Zranchev
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for
download; also available is the Q1'11
Roadmap for Telerik Windows Forms controls.