Problem with CreateOccurrence function

3 posts, 1 answers
  1. Richard
    Richard avatar
    32 posts
    Member since:
    Aug 2010

    Posted 26 Feb 2013 Link to this post

    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. Answer
    Svett
    Admin
    Svett avatar
    728 posts

    Posted 28 Feb 2013 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Richard
    Richard avatar
    32 posts
    Member since:
    Aug 2010

    Posted 28 Feb 2013 Link to this post

    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
Back to Top