search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Value cannot be null. Parameter name: collection

Asked by Dave
5 years ago.

Developed very simple example following the online samples and downloadable projects. I've included the code below the line return new Dpc().CallBack(this); throws the above error in MVC4, seems to be ok in MVC 3. Anything thoughts on what I am doing wrong? The unit of work is just me getting the event records out of the system using an existing unit of work. It returns records fine.

namespace DayPilotCalendarMvc3.Controllers
{
public class ScheduleController : Controller
{

/// <summary>
/// Default view
/// </summary>
/// <returns></returns>
public ActionResult Index()
{
return View();
}

/// <summary>
/// DayPilot backend
/// </summary>
/// <returns></returns>
public ActionResult Backend()
{
return new Dpc().CallBack(this);
}

/// <summary>
/// DayPilot handler class
/// </summary>
class Dpc : DayPilotCalendar
{
TrainingCourseBookingUnitOfWork unitOfWork = new TrainingCourseBookingUnitOfWork();

protected override void OnInit(InitArgs e)
{
Update(CallBackUpdateType.Full);
}

protected override void OnFinish()
{
if (UpdateType == CallBackUpdateType.None)
{
return;
}

Events = this.unitOfWork.EventRepository.Get();

DataIdField = "id";
DataTextField = "text";
DataStartField = "eventstart";
DataEndField = "eventend";
}

}

}
}

Answer posted by Dan Letecky [DayPilot]
5 years ago.

Dave, what's the version of DayPilot you are using?

If you are not using DayPilot Lite for MVC 1.2 already I recommend switching to to because it's compiled with MVC4.

http://mvc.daypilot.org/daypilot-lite-for-asp-net-mvc-1-2/

If you are using 1.2, can you please post the exception stack trace?

Comment posted by Dave
5 years ago.

Hi Dan,

I was using the Trial Pro Version 7.1. I switched to the version you recommended and all is well. Thanks for the support and quick response.

I'm looking at DayPilot for a major client of mine and once I have got to grips with the functionality I'll be looking at completing a purchase. Have the versions, pro, expert etc. that are available to purchase been compiled with MVC 4 or could they currently reproduce the same issue?

Again thanks for your help.

Dave

Comment posted by Dan Letecky [DayPilot]
5 years ago.

The Pro version is compiled with MVC4 since 7.1 release:

http://mvc.daypilot.org/daypilot-pro-for-asp-net-mvc-7-1/

You get the source code after purchase so you can recompile as needed (MVC2, MVC3).

Comment posted by Dave
5 years ago.

Is it only the purchased version that is recompiled for MVC4? I followed the link above and re-downloaded the DayPilotProMvcTrial-7.1.5456 version, later than 7.1, when I copied in the relevant files I am back to the error from the initial post. It would be good to get a pro trial version that works with MVC 4 as I need to evaluate the scheduler more than the calendar.

Comment posted by Dan Letecky [DayPilot]
5 years ago.

It looks like it's related to a bug recently fixed in the sandbox version. It throws an exception if you don't specify DataTagFields property. The workaround is to add any field there, e.g.:

DataTagFields = "id";

You can download build 5461 from the sandbox:

http://mvc.daypilot.org/sandbox/

Please let me know if it didn't help.

Comment posted by Anonymous
5 years ago.

I followed the link for the sandbox version and it presented me with version DayPilotProMvcTrial-7.1.5463. I downloaded this version and the error has now stopped happening.

I'm going to evaluate the scheduler etc. using this sandbox version. Is there anything specific you would like me to do if I believe I find an issue or should issues relating to sandbox versions be posted to this forum?

Comment posted by Dan Letecky [DayPilot]
5 years ago.

Thanks for the update.

You can post the issues here, no problem.

Version 7.1.5463 will be released as 7.1 SP2 in a few moments:

http://mvc.daypilot.org/daypilot-pro-for-asp-net-mvc-7-1-sp2/

This question is more than 6 months old and has been closed. Please create a new question if you have anything to add.