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

Scheduler not dynamically loading resources into scheduler control

Asked by John
11 years ago.

I have managed to get the calender working just fine but when I use the scheduler (using the same datasource control) and add the reference to the field in the database that has the name of the resource to the control at design time I just get the sceheduler with no resources and no events.

There is probably a very simple answer to this problem, have checked the demo and it appears that all this does is bind the resource to the resource data field in the database

Any ideas

Comment posted by Dan Letecky
11 years ago.

You need to fill the DayPilotScheduler.Resources collection. It can be done either statically in the .aspx file or in the code behind (Page_Load).

Static loading:

<daypilot:daypilotscheduler runat="server" id="DayPilotScheduler1" ... >
  <resources>
    <daypilot:resource value="A" name="Room A"></daypilot:resource>
    <daypilot:resource value="B" name="Room B"></daypilot:resource>
    <daypilot:resource tooltip="Test" value="C" name="Room C"></daypilot:resource>
  </resources>
</daypilot:daypilotscheduler>

Dynamic loading:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DayPilotScheduler1.Resources.Add("Room A", "A");
            DayPilotScheduler1.Resources.Add("Room B", "B");
            DayPilotScheduler1.Resources.Add("Room C", "C");
        }

	// ...
    }

Comment posted by John
11 years ago.

Thanks, but I have tried adding them into the resources collection. They appear in the scheduler as expected but I do not get the events associated with each of the resources.

Comment posted by Dan Letecky
11 years ago.

The Resource.Value is matched against the value of DataResourceField. The comparison is case sensitive. Could that be the problem?

Comment posted by John
11 years ago.

to be honest I do not know what the problem was. I recreated the database table, deleted the datasource control and scheduler control and started from scratch again and all now appears to be working fine. Thanks very much for your help. Great control

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