Silverlight Gantt assembly version 6.0.5.1
We experience the above error (line 70 in WorkTimeSchedule.cs) when rebinding the gantt which is required when adding a new resource to the gantt after the initial binding. ie
Users.Add(opResource); //resource collection already bound to the gantt
ganttControl.ItemsSource = null;
ganttControl.ItemsSource = App.ConfigOptions.Tasks.OrderBy(t => t.SortOrder);
It always seems to be related to milestones and predecessors but is difficult to pinpoint exactly.
Ie by trial and error if a specific predecessor is removed then the error no longer occurs.
We have implemented a fix but wanted to run the fix by you before we implement as the fix is to your code and we are uncertain of any possible ramifications regarding the fix.
We traced the issue back as far as line 542 of BaseGanttModel.cs in method ComputeEffort which for us looks like this.
public TimeSpan ComputeEffort(IActivity activity, DateTime suggestedEndTime)
{
DateTime startTime = activity.StartTime;
// Dont bother with this setting, as its quite probably just intermediate.
if (startTime == DateTime.MinValue || startTime == DateTime.MaxValue)
return TimeSpan.Zero;
Sometimes suggestedEndTime < startTime which results in the error.
We have modified it to
if (startTime == DateTime.MinValue || startTime == DateTime.MaxValue || suggestedEndTime < startTime)
return TimeSpan.Zero;
note the additional clause to prevent a negative timespan.
please could you advise if this fix is likely to cause any other issues? Or alternatively advise why a suggested end time for a milestone will ever be less than it's actual start time.
Regards,
Sean.