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

DayPilot Calendar for MVC

Asked by Anonymous
9 years ago.
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
Answer posted by Dan Letecky [DayPilot]
9 years ago.

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);
                   
                }
            }
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.