I have a problem when I save my tasks from my current project to the database. When I save it to my database, I can't open my tasks properties anymore and the also the Predecessors field is cleared (as you can see in the screenshot). Screenshot 1 is before saving, screenshot 2 is after doing:
foreach (Project prj in this.ultraCalendarInfo1.Projects)
for (int i = 0; i < prj.Tasks.Count; i++)
DataRow taskRow = this.ds.Tables["Tasks"].Select("TaskID = '" + prj.Tasks[i].Id + "'");
if (taskRow.Length == 1)
taskRow["RowIndex"] = i;
With tda being:
tda = new SqlDataAdapter();
SqlCommand cmdT = conn.CreateCommand();
cmdT.CommandText = "SELECT * FROM Task order by ProjectKey, RowIndex";
tda.SelectCommand = cmdT;
sqlCmdBuilderT = new SqlCommandBuilder(tda);
I know it has something to do with the foreach loop. But I need that before the save so I can keep the current order in the tasks. Because when I save without the foreach the defaultsort on date will be used and the order will be gone.
Thank you for contacting Infragistics. Please review my sample below, as it demonstrates how to save predecessor information to the UltraGanttView. If the issue still persists on your end, please modify the sample attached demonstrating the behavior and I will investigate this for you.
Let me know if you have any questions.
The problem wasn't adding the predecessors, the problem was when I saved my project to the database the predecessors where removed but where still visualized. I solved this by adding:
tda.Update(ds, "Tasks"); ds.AcceptChanges(); //This did the trick
So thank you for your answer but I think you misunderstood the question. None the less, the problem is solved.
Thanks for following up. I am glad you were able resolve this. Let me know if you have any additional questions.