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

RadGantt Object

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

 

NameParametersReturn TypeDescription
get_tasksnoneTelerik.Web.UI.GanttTaskCollectionGets a collection with all root level tasks.
get_allTasksnoneTelerik.Web.UI.GanttTask ArrayGets a collection with all tasks. See Example 1.
get_dependenciesnoneTelerik.Web.UI.GanttDependencyCollectionGets a collection with all dependencies. See Example 2.
get_resourcesnoneTelerik.Web.UI.GanttResourceCollectionGets a collection with all resources.
get_assignmentsnoneTelerik.Web.UI.GanttAssignmentCollectionGets a collection with all resource assignments.
get_selectedViewnoneTelerik.Web.UI.GanttViewTypeGets the selected view mode.
get_scrollTopnoneintReturns the vertical scroll bar position.
get_scrollLeftnoneintReturns the horizontal scroll bar position.
get_elementnoneHTMLElementGets the control's DOM element.
get_enablednonebooleanReturns a boolean value indicating whether the control is enabled.
exportToPdfnonenoneExports the RadGantt to .pdf if the EnablePdfExport property is true.
get_allowColumnResizenonebooleanTrue if the allowColumnResize property is enabled, false otherwise.
get_currentTimeMarkerIntervalnoneintReturns the value of the Gantt's currentTimeMarkerInterval property.
get_displayDeleteConfirmationnonebooleanTrue if the displayDeleteConfirmation property is enabled, false otherwise.
get_heightnoneintReturns the height of the Gantt's DOM element.
get_hourSpannoneintReturns the value of the Gantt's hourSpan property.
get_listWidthnonestringReturns the width of the RadGantt's TreeList view.
get_rowHeightnoneintReturns the value of the Gantt's rowHeight property.
get_showCurrentTimeMarkernonebooleanReturns the value of the Gantt's showCurrentTimeMarker property.
get_showFullTimenonebooleanReturns a boolean value indicating whether a complete day or a range between 8:00 AM and 5:00 PM is displayed.
get_showFullWeeknonebooleanReturns a boolean value indicating whether all days of the Gantt's week are displayed or a range between WorkWeekStart and WorkWeekEnd.
get_showTooltipnonebooleanReturns a boolean value indicating whether showing tooltips for Gantt tasks is enabled.
get_widthnoneintReturns the width of the Gantt's DOM element.
get_workWeekEndnoneTelerik.Web.UI.DayOfWeekReturns the last day of the work week.
get_workWeekStartnoneTelerik.Web.UI.DayOfWeekReturns the first day of the work week.
set_allowColumnResizebooleannoneEnables/Disables column resizing. See Example 3.
get_rangeStartnoneDateReturns the value of the Gantt's rangeStart property.
get_rangeEndnoneDateReturns the value of the Gantt's rangeEnd property.
get_selectedDatenoneDateReturns the value of the Gantt's selectedDate property.
set_currentTimeMarkerIntervalintnoneSets the value of the Gantt's currentTimeMarkerInterval property. See Example 4.
set_displayDeleteConfirmationbooleannoneEnables/Disables confirmation dialog when the user deletes a task or a dependency.
set_heightintnoneSets the height of the Gantt's DOM element. See Example 5.
set_hourSpanintnoneSets the hour span.
set_listWidthstringnoneSets the width of the Gantt's TreeList view.
set_rowHeightintnoneSets the rows height.
set_selectedViewintnoneSets the selected view mode. See Example 6.
set_scrollLeftintnoneSets the horizontal scroll bar position.
set_scrollTopintnoneSets the vertical scroll bar position.
set_showCurrentTimeMarkerbooleannoneShows/Hides the Gantt's current time marker.
set_showFullTimebooleannoneEnables displaying the Gantt's complete day or displays a range between 8:00 AM and 5:00 PM.
set_showFullWeekbooleannoneEnables displaying all days of the Gantt's week or diplays the range between WorkWeekStart and WorkWeekEnd.
set_showTooltipbooleannoneEnables/Disables displaying tooltips for Gantt tasks.
set_widthintnoneSets the width of the Gantt's DOM element.
set_workWeekEndintnoneSets the Gantt's last day of the work week. See Example 7.
set_workWeekStartintnoneSets the Gantt's first day of the work week.
set_rangeStartDatenoneSets the value of the Gantt's rangeStart property. See Example 8.
set_rangeEndDatenoneSets the value of the Gantt's rangeEnd property. See Example 9.
set_selectedDateDatenoneSets the value of the Gantt's selectedDate property. See Example 10.

 Example 1: Get a collection with all Gantt tasks.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
var allTasks = gantt.get_allTasks();  

 Example 2: Get the id of the first dependency in the Gantt's DependencyCollection.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
var firstDependency = gantt.get_dependencies().getDependency(0); 	
var id = firstDependency.get_id();	

 Example 3: Enable column resizing.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
gantt.set_allowColumnResize(true); 	

 Example 4: Set the current time marker interval to 5000.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
gantt.set_currentTimeMarkerInterval(5000); 		

 Example 5: Set the Gantt's height to 700px.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
gantt.set_height(700); 		

 Example 6: Set the Week view as selected.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
gantt.set_selectedView(1); 	

 Example 7: Set the work week end to Thursday.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
gantt.set_workWeekEnd(4); 	

Example 8: Set the range start.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
gantt.set_rangeStart(new Date("2014/06/09"));	

Example 9: Set the range end.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
gantt.set_rangeEnd(new Date("2014/06/18"));	

Example 10: Set the selected date.

JavaScript
var gantt = $find("<%= RadGantt1.ClientID %>");
gantt.set_selectedDate(new Date("2014/06/10"));	

See Also

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