Value cannot be null. Parameter name: key

2 posts, 0 answers
  1. Toxic
    Toxic avatar
    20 posts
    Member since:
    Apr 2011

    Posted 11 Apr 2011 Link to this post


    I have a data bound radscheduler. For which I have created a timeslotcontextmenu eg. Add Appointment and set to postback.

    However, everytime I click on the context menu I get the above error with the following stack trace :
     
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentNullException: Value cannot be null.
    Parameter name: key

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [ArgumentNullException: Value cannot be null.
    Parameter name: key]
       System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +44
       System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +7457569
       System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) +16
       Telerik.Web.UI.RadScheduler.ProcessTimeSlotContextMenuItemCommand(SchedulerPostBackEvent postBack) +106
       Telerik.Web.UI.RadScheduler.ProcessPostBackCommand(SchedulerPostBackEvent postBack) +4638
       Telerik.Web.UI.RadScheduler.RaisePostBackEvent(String eventArgument) +108
       Telerik.Web.UI.RadScheduler.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +39
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    


    All other changes to the schedule work fine (moving dates etc.) but the context menu click just comes up with thie error everytime and I cannot understand why.

    Please help!
  2. Toxic
    Toxic avatar
    20 posts
    Member since:
    Apr 2011

    Posted 12 Apr 2011 Link to this post

    I have resolved this. I decided to carry on with the coding and noticed I was missing a return value for the item clicked!!!

    That was the NULL valued key required, the value of the radmenuitem. This obviously cannot be left blank.

    Simple if you think about it.

    Tox
Back to Top