Hi all,
I'm in trouble with the GanttChart.
I'm trying to use the dafult command provided with the demos for manage the tasks like add, insert and in/outdent.
But if I try to indent a child to another this line disappear from the grid but it is still present as object in the taskdetail list and in the ganttchart.
Example in attachments.
Thanks in advance.
Attachment:
files_1dc10ee6.zip
EDIT:
Code I'm using for indent (taken from the examples)
GanttControl gantt = this.GanttAttivita;
if (CanIndent())
{
for (int i = 0; i < 1; i++)
{
TaskDetails currentTask = gantt.SelectedItems[i] as TaskDetails;
TaskDetails parentTask = gantt.Model.GetParentOfItem(currentTask) as TaskDetails;
if (parentTask == null)
{
int index = gantt.Model.InbuiltTaskCollection.IndexOf(currentTask);
if (index < 1)
continue;
gantt.Model.InbuiltTaskCollection.Remove(currentTask);
gantt.Model.InbuiltTaskCollection[index - 1].Child.Add(currentTask);
}
else
{
int currentIndex = parentTask.Child.IndexOf(currentTask);
if ((currentIndex - 1) >= 0)
{
parentTask.Child.Remove(currentTask as IGanttTask);
parentTask.Child[currentIndex - 1].Child.Add(currentTask);
}
}
gantt.SelectedItems.Clear();
gantt.SelectedItems.Add(currentTask);
}
}