In my application I have to assign the predecessor tasks for dependent tasks. Once i assign the Predecessor, i have to save in a table. After save i have to retrieve and assign the Predecessor. How to bound the saved predecessor?
Hello,
In order to add predecessor for any task you should use its Dependencies collection property. Please use code like Task1.Dependencies.Add(Task2, TaskDependencyType.FinishToStart);. For more information please see the following links.:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinSchedule.v11.1~Infragistics.Win.UltraWinSchedule.Task~Dependencies.html
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinSchedule.v11.1~Infragistics.Win.UltraWinSchedule.TaskConstraint.html
once you have added a dependencies, this will be write up into “AllProperties” column of the underlying data table if you are using the following model for binding of UltraGanttView:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/WinGanttView_DataBinding_Support_for_WinGanttView.html
I have created a small sample, where I am reading my DataSource from xml. In the sample is shown how to add predecessor via code and also you could save made changes.
Please let me know if you have any further questions.
Thanks For your Samples, I run the Samples, but you didNot display the any values in Predecessors like 8FS, 3SS while retrive values from datatable. For example, When i create New Schedule for my task i use predecessor for second Row is 1FS in prdecessor. After i save the Data, i have to retrive again the Same set of data and also dispaly 1FS in predecessor in second ROW.
How to do it?
Thanks in advance....
Hi,
I just wanted to know if you were able to solve your issue based on my suggestions or you still need help? Just let me know.
Thank you.
Hello ,
I have tested and reviewed the sample, which I have sent you and I can verify that my data is coming from an xml (GetSimpleData method). So the data which UltraGanttView displays for the very first time is from the data table, which is loaded from the xml. And as far as I can see( please see attached picture)
there is a value like 2FS in Predecessors column for the third row (Allocate Teams), and I can verify that this value is retrieved from the data table. Please see the attached video. Also my sample demonstrates how to set Predecessors programmatically, if you press “Add Dependency between TestPhase1 and TestPhase2” button you will get a Predecessors for the ninth row. Also you could save this changes, pressing “Save” button, and next time when you run the sample , you will have two values in Predecessors column for the third and ninth rows.
If you want to add Predecessor, during the adding of the tasks, you could handle TaskAdded event of the UltraGantView and to add Dependency, for the new added task. The reference for the new added task, you could find in Task property of the argument of the event (e.Task).
Please let me know if I am missing something.