This is a migrated thread and some comments may be shown as answers.

Problem with CreateOccurrence function

2 Answers 86 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 26 Feb 2013, 07:08 AM
Hi, 

I was using RadScheduler version 2011.2.11.831 and recently I have downloaded 2013.1.220.20 and started testing. But within CreateOccurrence function, the below code gives an error. 

'For repeated occurrences..
Dim appType As Type = GetType(Telerik.WinControls.UI.Appointment)
appType.GetField("masterEvent", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(appointment, Me)

appType.GetField("masterEvent", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
is returning nothing and this causes an exception. 

This was working perfectly fine with RadScheduler 2011.2.11.831 version. 

I am using VB.NET in VS 2010 

Regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Svett
Telerik team
answered on 28 Feb 2013, 03:11 PM
Hello Richard,

Thank you for writing.

You should use the following code snippet instead:
Dim appType As Type = GetType(Telerik.WinControls.UI.Event)
Dim f As FieldInfo = appType.GetField("masterEvent", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)

I hope this helps.

All the best,
Svett
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Join us for a FREE webinar to see all the new stuff in action.

Interested, but can’t attend? Register anyway and we’ll send you the recording.
0
Richard
Top achievements
Rank 1
answered on 01 Mar 2013, 01:22 AM
Hi Svett,
Thanks for the reply and as per your reply, I make the below changes and my Scheduler is working fine. 

Dim appType As Type = GetType(Telerik.WinControls.UI.Event)
appType.GetField("masterEvent", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(appointment, Me)

Thanks & Regards
Richard
Tags
Scheduler and Reminder
Asked by
Richard
Top achievements
Rank 1
Answers by
Svett
Telerik team
Richard
Top achievements
Rank 1
Share this question
or