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

Value cannot be null. Parameter name: key

1 Answer 681 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Toxic
Top achievements
Rank 1
Toxic asked on 11 Apr 2011, 02:45 PM

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!

1 Answer, 1 is accepted

Sort by
0
Toxic
Top achievements
Rank 1
answered on 12 Apr 2011, 08:43 PM
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
Tags
Scheduler
Asked by
Toxic
Top achievements
Rank 1
Answers by
Toxic
Top achievements
Rank 1
Share this question
or