Home Unanswered Active Tags New Question

DayPilot Calendar for MVC

We are currently looking to migrate some of our applications from ASP.NET 3.5 over to using ASP.NET MVC instead and are having difficulty when using the trial version of DayPilot for MVC to get the calendar working as it did previously. In the ASP.NET version of DayPilot it was possible to specify resource headers underneath the date. We accomplished this by clearing the Columns and then building the Columns as we would expect them to look, setting HeaderLevels to 2 and setting ViewType to Resource. I have attempted doing the same with the trial version for MVC and this causes a yellow screen in GetColumns(), changing the ViewType back to Day removes this error but also does not show the child columns that we specified. Is this possible in the MVC version? and if so, please can you advise how I would go about doing this. Thanks in advance
Asked by Anonymous 11 months ago.
Replies

The latest sandbox build now contains a demo page that shows a hierarchy of resources:

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

The sources is a modified Calendar/Index example.

1. The following two lines are added to the view:

ViewType = DayPilot.Web.Mvc.Enums.Calendar.ViewType.Resources,
HeaderLevels = 2,

2. It adds the resources on the server side during the first automatic AJAX call (OnInit):

            protected override void OnInit(InitArgs initArgs)
            {
                UpdateWithMessage("Welcome!", CallBackUpdateType.Full);

                if (Id == "days_resources") // just applying it to DaysResources view
                {
                    Columns.Clear();
                    Column today = new Column(DateTime.Today.ToShortDateString(), DateTime.Today.ToString("s"));
                    today.Children.Add("A", "a", DateTime.Today);
                    today.Children.Add("B", "b", DateTime.Today);
                    Columns.Add(today);

                    Column tomorrow = new Column(DateTime.Today.AddDays(1).ToShortDateString(), DateTime.Today.AddDays(1).ToString("s"));
                    tomorrow.Children.Add("A", "a", DateTime.Today.AddDays(1));
                    tomorrow.Children.Add("B", "b", DateTime.Today.AddDays(1));
                    Columns.Add(tomorrow);
                   
                }
            }
Answer posted by Dan Letecky [DayPilot] 10 months ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java