Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1075
Problem with 'Finish No Later Than' constraint
posted

Hi,

When I have task with constraint 'Finish No Later Than', I get some weird results. It seems the original start date (set with 'Start No Earlier Than') is used for calculating the actual start date for 'Finish No Later Than'. This gives me problems, because in our software I have to calculate the start dates using our own algorithm (which should match the way Infragistics calculates the dates).

To demonstrate why I think that the UltraGanttView might have incorrect behaviour, I've made the following sample project. Please create a Windows Forms application and replace Form1.cs with the following code:

using System;
using System.Drawing;
using System.Windows.Forms;
using Infragistics.Win.UltraWinGanttView;
using Infragistics.Win.UltraWinSchedule;

namespace WindowsFormsApplication1 {
  public partial class Form1 : Form {
    public Form1() {
      InitializeComponent();
    }

    protected override void OnLoad(EventArgs e) {
      base.OnLoad(e);

      var ganttView = new UltraGanttView();
      var calendarInfo = new UltraCalendarInfo();

      ganttView.Dock = DockStyle.Fill;
      ganttView.CalendarInfo = calendarInfo;
      ganttView.Project.StartDate = new DateTime(2014, 1, 1);
      Controls.Add(ganttView);

      var task1 = new Task {
        StartDateTime = new DateTime(2014, 1, 8),
        Duration = TimeSpan.FromDays(5)
      };
      var task2 = new Task {
        StartDateTime = new DateTime(2014, 1, 1),
        Duration = TimeSpan.FromDays(5),
        Constraint = TaskConstraint.FinishNoLaterThan,
        ConstraintDateTime = new DateTime(2014, 2, 1)
      };

      task2.Dependencies.Add(task1, TaskDependencyType.FinishToStart);

      calendarInfo.Tasks.Add(task1);
      calendarInfo.Tasks.Add(task2);

      ganttView.EnsureDateTimeVisible(ganttView.Project.StartDate.AddDays(-1));
    }
  }
}

Task 2 should start after task 1 has ended (the constraint date allows this to happen), but it follows the StartDateTime set in the object initializer of task2. Could you tell me why this is happening? I am using version 10.3.20103.2145, although this also seems to happen in later versions.

Parents Reply Children
No Data