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

GanttTask Object

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

 

NameParametersReturn TypeDescription
get_idnonestringGets the id of the task. See Example 1.
get_parentIdnonestringGets the parentId of the task.
get_orderIdnonestringGets the orderId of the task.
get_startnoneDateGets the start time of the task.
get_endnoneDateGets the end time of the task.
get_titlenonestringGets the Title of the task.
get_percentCompletenonestringGets the task percentage of completion.
get_summarynonebooleanGets a boolean value indicating whether the task has child tasks.
get_expandednonebooleanGets a boolean value indicating whether the task is expanded.
get_tasksnoneTelerik.Web.UI.GanttTaskCollectionGets a collection with all child tasks.
get_dependenciesnoneTelerik.Web.UI.GanttDependencyCollectionGets a collection with all task dependencies.
get_predecessorsnoneTelerik.Web.UI.GanttDependencyCollectionGets a collection with all task predecessors.
get_successorsnoneTelerik.Web.UI.GanttDependencyCollectionGets a collection with all task successors.
get_elementnoneHTMLElementGets the HTMLElement of the task.
set_startDatenoneSets the start date of the task. See Example 2.
set_endDatenoneSets the end date of the task.
set_titlestringnoneSets the title of the task.
set_percentCompleteintnoneSets the task percentage of completion.
set_expandedbooleannoneSets a boolean value indicating whether the task is expanded. See Example 3.

 Example 1: Get the id of the first task in the GanttTaskCollection.

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

 Example 2: Set the start time of the first task in the GanttTaskCollection.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
var startDate = new Date(2016,6,14,10,30,0,0);
gantt.get_tasks().getTask(0).set_start(startDate);

 Example 3: Expand the first task in the GanttTaskCollection.

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

See Also

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