New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

GanttTaskCollection Object

The following table lists the most important methods of the GanttTaskCollection client-side object:

 

NameParametersReturn TypeDescription
addTelerik.Web.UI.GanttTasknoneAdds a task to the collection.
insertint, Telerik.Web.UI.GanttTasknoneInserts a task into the collection at the position specified by the first (index) parameter.
removeTelerik.Web.UI.GanttTasknoneRemoves a task from the collection. See Example 1.
get_countnoneintGets the number of tasks in the collection.
getTaskintTelerik.Web.UI.GanttTaskGets the task from the collection residing at the index specified by the parameter.
indexOfTelerik.Web.UI.GanttTaskintGets the index of a task.
toArraynonearrayReturns the collection of tasks represented as array.

 Example 1: Get a reference to the first task in the GanttTaskCollection and remove it.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
var firstTask = gantt.get_tasks().getTask(0);  
gantt.get_tasks().remove(firstTask);

See Also

In this article
See Also
Not finding the help you need?
Contact Support