Resources
Note
Resources and resource assignments are optional in the Gantt control.
Resources specify people responsible for tasks, equipment, materials, and so forth.
Use the following APIs to specify whether the Gantt hides resources or displays them as task labels:
The ShowResources server-side property.
<dx:ASPxGantt ID="Gantt" runat="server" ... > <SettingsGanttView ShowResources="false" /> ... </dx:ASPxGantt>
The ShowResources(value) client-side method.
// Set a control's ClientInstanceName property to access the control on the client side. clientGantt.ShowResources(false);
Resource assignments specify which resources are assigned to tasks. You can assign multiple resources to a task.
The Gantt gets data for resources and resource assignments from separate data sources (ResourcesDataSourceID and ResourceAssignmentsDataSourceID). Use the Resource and ResourceAssignment objects to specify which fields in the data sources correspond to properties of the resource and resource assignment.
<dx:ASPxGantt ID="Gantt" runat="server" ResourceDataSourceID="ResourcesDataSource" ResourceAssignmentsDataSourceID="ResourceAssignmentsDataSource" ... >
<Mappings>
<Resource Key="ID" Name="Name" Color="Color" />
<ResourceAssignment Key="ID" TaskKey="TaskID" ResourceKey="TeamID" />
...
</Mappings>
...
</dx:ASPxGantt>
<asp:SqlDataSource ID="ResourcesDataSource" runat="server"
ConnectionString='<%$ ConnectionStrings:DevelopmentGanttConnectionString %>'
SelectCommand="SELECT * FROM [Teams]" />
<asp:SqlDataSource ID="ResourceAssignmentsDataSource" runat="server"
ConnectionString='<%$ ConnectionStrings:DevelopmentGanttConnectionString %>'
SelectCommand="SELECT * FROM [TaskTeamRelations]" />