New to Kendo UI for jQuery? Download free 30-day trial

Change the Resources of Gantt for ASP.NET MVC Depending on the Edited Task


Product Progress® Telerik® UI Gantt for ASP.NET MVC


How can I populate the Assignments edit dialog based on the StartDate and EndDate of the edited task after checking from the server which are the resources that are available for the selected date and time?


  1. Handle the edit event of the Gantt.
  2. In the edit event, retrieve and store the start and end date in global variables.
  3. Trigger the read() call on the Resources DataSource.

    function onEdit(e) {
      var task = e.task;
      var gantt = e.sender;
      window.start = task.start;
      window.end = task.end;
  4. Configure a Data() function for the Resources Read action. As a result, you will be able to filter the returned Resources based on the start and end time of the task on the server.

    .Resources(r => r
        .DataSource(d => d
            .Schema(s => s
                .Model(m => m.Id("ID"))
            .Transport(t =>
                t.Read("ReadResources", "Gantt").Data("onResourcesRead");
    function onResourcesRead() {
      return {
        start: window.start,
        end: window.end

See Also

In this article