By default when the user connects 2 tasks a "Finish to Start" depedency will be setup. You can override this behavior by providing a NewDependencyValidator method as follows:
this.ganttControl.ItemsSource = taskItems;
// Do this after assigning the ItemsSource
((BaseGanttModel)this.ganttControl.Model).NewDependencyValidator = this.NewDependencyValidator;
Then implement the above method as follows:
bool NewDependencyValidator(IActivity from, IActivity to, NewDependencyAddScenarioType addType)
{
// Setup a workaround to change default dependency types to FF rather than FS.
if (addType == NewDependencyAddScenarioType.UserDragDrop)
{
// If the user has connected 2 tasks in the Chart to setup dependency, first cancel that op, by returning false below....
this.Dispatcher.BeginInvoke(
(ThreadStart)delegate()
{
// .... and instead create a new FF dependency here.
this.ganttControl.Model.CreateNewDependency(from, to, DependencyType.FinishToFinish, TimeSpan.Zero);
}
);
return false;
}
else
{
// All other scenarios, simply return true to allow normal processing.
return true;
}
}
� RadiantQ 2009 - 2019. All Rights Reserved.