I would like an example of how I can load tasks manually into a Gantt.... not a data binding but something similar to:
then... RadGantt.DataBind() or something to get it to update from code behind in C#
5 Answers, 1 is accepted
I've attached a sample page where the Gantt control is bound entirely in code behind, with implementation for every CRUD operation.
Thank you for the response. I have looked at this example already and I have an issues more related to timing I suppose in getting this to work.
I have a search box that I use to search for a work order. I respond to the search request and pull that work order information out of the database and then set some fields on the page as part of the response.
What I don't understand are 2 things:
1. When is the Task list updated?
2. How can I manually update the Tasks list and force and update during the time that I am gathering the information from the work order from the original search request.
I tried to mimic what you did for Tasks in the segment of code where I gather the information:
List<Task> sessionTasks = Session[TasksKey] as List<Task>;
if (sessionTasks == null)
sessionTasks = new List<Task>();
Task sr_start = new Task();
sr_start.ID = 1;
sr_start.Start = wo.ReportedDate;
sr_start.End = wo.ActualStart;
sr_start.Title = "SR Created";
sr_start.OrderID = 0;
foreach(WorkOrderHistory woh in wo.history)
Task t = new Task();
t.ID = 1;
t.Start = woh.Date;
t.Title = woh.Status;
Debug.WriteLine("Added: " + woh.Status);
Session[TasksKey] = sessionTasks;
But, it does not update the tasks... worse yet, the page freezes and crashes in Chrome.
How could I accomplish this? Or, if you can give me a better method to accomplish this I am OK with that as well.
1. When is the Task list updated? - In the provided sample the list is stored in Session, so that the changes made on the client will be preserved upon each postback. In the sample the list itself is not updated. On Created, Delete and Update operations a server event is triggered and items are added or removed from the list.
2. If you want to reset the list, you simply have to clear the Tasks collection and add the new items. I've updated the sample project, adding a button. On button click the gantt data is cleared and a new task is added, simulating your use case.
i got error 404, when trying to download the Gantt.zip file.
Is it stillavailable?