Hi Vignesh,
thank you for your help, ok, let me detail the situation.
Here is a snapshot of the Resource View example, where more than one task nodes are displayed in a row:
And here's a snapshot from the Essential Gantt example, I marked the precessor lines with red:
What I'd like to achieve is basically the Resource View above, but I'd also like to display Predecessor lines between certain task nodes to indicate their relation.
I tried to achieve that by modifying the Resource View example:
1. added TaskId and Predecessor mapping into the XAML markup:
<gantt:TaskAttributeMapping TaskIdMapping="TaskId"
TaskNameMapping="TaskName"
StartDateMapping="StartDate"
ChildMapping="Child"
FinishDateMapping="FinishDate"
ProgressMapping="Progress"
InLineTaskMapping="InLineItems"
PredecessorMapping="Predecessor"/>
2. Added TaskId and Predecessor properties to the Item class:
public int TaskId
{
get
{
return _taskId;
}
set
{
_taskId = value;
RaisePropertyChanged("TaskId");
}
}
public ObservableCollection<Predecessor> Predecessor
{
get
{
return _predecessor;
}
set
{
_predecessor = value;
_predecessor.CollectionChanged += ItemsCollectionChanged;
UpdateDates();
this.RaisePropertyChanged("Predecessor");
}
}
3. Changed the ViewModel construction by additionally setting TaskIds and Predecessors:
Item Person = new Item() { TaskId = 100101, TaskName = "Robert" };
Person.InLineItems.Add(new Item() { TaskId = 1, StartDate = new DateTime(2012, 01, 07), FinishDate = new DateTime(2012, 01, 11),TaskName = "Market Analysis", Progress = 50d });
Person.InLineItems.Add(new Item() { TaskId = 2, StartDate = new DateTime(2012, 01, 11,12,0,0), FinishDate = new DateTime(2012, 01, 17),TaskName = "Competitor Analysis", Progress = 20d });
Person.InLineItems.Add(new Item() { TaskId = 3, StartDate = new DateTime(2012, 01, 17,12,0,0), FinishDate = new DateTime(2012, 01, 21),TaskName = "Design Spec" });
teams.Add(Person);
Person = new Item() { TaskId = 100102, TaskName = "Michael" };
Person.InLineItems.Add(new Item() { TaskId = 4, StartDate = new DateTime(2012, 01, 14), FinishDate = new DateTime(2012, 01, 19),TaskName = "Basic Requirement Analysis", Progress = 40 });
Person.InLineItems[0].Predecessor.Add(new Predecessor { GanttTaskIndex = 1, GanttTaskRelationship = GanttTaskRelationship.FinishToStart });
Now, I expected the Resource View to draw these Predecessor lines on the diagram, however, it does not.
There are no exceptions thrown, everything works, dragging, resizing nodes, etc., only the Predecessor lines are not displayed.
(In the attachment you can find the CS solution zipped)
Hope this helps,
Thanks in advance for your help,
Sandor
Attachment:
CS_356e410d.ZIP