Displaying dependency lines for to successor tasks that are not yet loaded due to virtualization with Gantt Chart Light Library

By default GanttChartDataGrid and GanttChartView controls from Gantt Chart Light Library use virtualization, which means that content template for chart items is actually applied and loaded only when the items get actually visible in the viewport, such as when the end user scrolls down the chart area to view those items.

Sometimes, however, you may want to pre-load the content template for specific items before that happens. For example, you may want to display dependency lines to successor items even if they haven't yet been scrolled to.

To obtain the desired effect, you will simply need to set IsVirtuallyVisible property to true for the items you want to get pre-loaded in the user interface. When using virtualization (i.e. IsVirtualizing property is set to true on the component, such as by default) IsVirtuallyVisible property values are initialized to false, but once they become true (either automatically or set in your custom code), they are never reset.

Note that the dependency lines are displayed together with the target dependent items (as predecessor item definitions are stored within the Predecessors collection of those successor items).

foreach (GanttChartItem item in itemsToPreload)
    item.IsVirtuallyVisible = true;