Hi,
I have multiple task with link between them for constraints.Each task is linked to a project.
Sample of my database :
Task1, starts on 01/01/2014, duration of 4 days.Task2, starts when Task1 is over (05/01/2014), duration of 10 dayz. (Link to Task1 with TaskparentId)
Task3, start on 01/01/2014, duration of 15 days.No substask
Task4, start on 01/01/2014, duration of 3 days. 3 subtasks, linked to each other.
I want to see all my task in the same gantt. (See picture top image).And I'd like to see what is the project of tasks.(How to not show week ends ? nobody works week ends here ^^)
But with your control, i created Data with 1 project (to see all my task in the same window), and add all task with parenttask.Many tasks has wierd startdate , duration set to 0 and are "disabled" in the task table. (See picture bottom image).
I don't understand how your control works.
The code for creating Data
foreach (DataRow dr in ds.Tables[0].Rows) { idTache = int.Parse(dr["IdTache"].ToString()); dtDebutTache = Convert.ToDateTime(dr["DteDebutTache"]); dtFinTache = Convert.ToDateTime(dr["DteFinTache"]); duration = dtFinTache - dtDebutTache; if (dr["IdTacheParent"] != null && !string.IsNullOrEmpty(dr["IdTacheParent"].ToString())) { theTasks.Rows.Add(new Object[] { lstGuid[idTache], projectKey, dr["TxtNomTache"].ToString(), dtDebutTache, duration, lstGuid[Convert.ToInt32(dr["IdTacheParent"].ToString())], TaskConstraint.StartNoEarlierThan, null }); } else { theTasks.Rows.Add(new Object[] { lstGuid[idTache], projectKey, dr["TxtNomTache"].ToString(), dtDebutTache, duration, null, TaskConstraint.AsSoonAsPossible, null }); } }
Thanks.
So ... there is some improvment to my tests.
I'm adding Tasks to represent ProjectsI'm adding tasks to represent Projects' Tasks, with a parent link to the project Guid.
Sample :
Tasks.add(myProject,null);
foreach(task in myProject) Task[myProject].Tasks.add(task, myproject);
I have a summary task filled with tasks.
Its OK but i have to set Date start and Date end on each task.But how can we set a task start just after the end of the previous task ?Because if I modify the end date of a task, the next task doesn't change its date start.
How can we add columns ? I looked into all your samples, but nothing s working.
Vincent,
You have to add a Dependency and a Constraint to the Task. So, let's say you have a Task object called teamTask, you could do something like this:
teamTask.Dependencies.Add(budgetTask, TaskDependencyType.FinishToStart);
teamTask.StartDateTime = budgetTask.StartDateTime.AddDays(1);
teamTask.Constraint = TaskConstraint.AsSoonAsPossible;
As for the columns, take a look at this article:
http://help.infragistics.com/doc/WinForms/2013.2/CLR4.0/?page=WinGanttView_Custom_Columns.html
Let me know if you have further questions.
Thanks for Dependancies, but CustomColumn I can't do it. Already read the link u gave me.
But I don't have CustomTaskColumns. For info, i'm on Infragistics2 v10.2
Thanks very much.
EDIT : I updated my version and its ok.