With the latest builds of Gantt Chart Light Library, the WPF based GanttChartDataGrid component may level resources for you by taking item priorities in considerations as well.
To set it up, simply update GanttChartItem.LevelingPriority int values from their zero default on yout leaf items according to your needs, and there you go – when you’ll call LevelResources() method of the component, the tasks would be rescheduled so that resources are not overallocated and also ensuring that for any resource the assigned item that have higher priority will be scheduled before any other items assigned to the same resource.
It’s also easy to setup a column allowing end user to set up leveling priorities, if you want. However, we recommend that you hide these values for summary items (as they are irrelevant in resource leveling algorithm’s context):
<DataGridTemplateColumn Header=”Priority”>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Name=”TextBlock” Text=”{Binding LevelingPriority}”
Padding=”4,2″/>
<DataTemplate.Triggers>
<DataTrigger Binding=”{Binding HasChildren}” Value=”True”>
<Setter TargetName=”TextBlock” Property=”Visibility”
Value=”Collapsed”/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Name=”TextBox” Text=”{Binding LevelingPriority}”
Padding=”1,1″/>
<DataTemplate.Triggers>
<DataTrigger Binding=”{Binding HasChildren}” Value=”True”>
<Setter TargetName=”TextBox” Property=”Visibility”
Value=”Collapsed”/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>