Skip to main content
All docs
V22.1

ASPxClientGanttTaskShowingEventArgs.item Property

Contains information about a task object and its settings.

Declaration

item: any

Property Value

Type Description
any

Information about a task object and its settings.

Remarks

The item property returns the following information about a task object and its settings:

  • cellSize (Size) - Cell size.

  • isMilestone (Boolean) - Specifies whether or not a task is a milestone.

  • taskData - Task data. Ensure that task field names correspond to the field names in your database.

    • Color - Task color.

    • EndDate - Task end date.

    • ID - Task ID.

    • ParentID - A task’s parent ID.

    • PercentComplete - Task progress.

    • StartDate - Task start date.

    • Subject - Task title.

  • taskHTML - A task’s HTML content.

  • taskPosition - Task position.

  • taskResources - Task resources.

  • taskSize - Task size.

Web Forms:

<dx:ASPxGantt ID="Gantt" >
    <ClientSideEvents TaskShowing="function(s, e) {
        var customContainer = document.createElement("div");  
        customContainer.classList.add("custom-task");  
        customContainer.setAttribute("style", "width:" + e.item.taskSize.width + "px;");  
        customContainer.textContent = e.item.taskData["Subject"];  
        e.container.appendChild(customContainer);
    }" />
</dx:ASPxGantt>

MVC:

@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    settings.ClientSideEvents.TaskShowing = "function (s, e) { 
        var customContainer = document.createElement("div");  
        customContainer.classList.add("custom-task");  
        customContainer.setAttribute("style", "width:" + e.item.taskSize.width + "px;");  
        customContainer.textContent = e.item.taskData["Subject"];  
        e.container.appendChild(customContainer);    
    }";
    ...
}).Bind(
    GanttDataProvider.Tasks, GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, GanttDataProvider.ResourceAssignments
).GetHtml()
See Also