10247 : Clear the Gantt

Question

I am using my gantt for some different views and I am able to switch those views. I use one gantt for those views, because most methods are the same, only the gantt is filled or displayed in another way.

To clear my gantt before re-filling, I use:

GNT_Plan.Grid.GridStructure.Columns.Clear()

GNT_Plan.Grid.GridStructure.RootNodes.Clear()

This works in most cases, but sometimes gives me strange errors. What is the fastest and most effective way to clear my gantt (columns and nodes with subnodes and timeitems and links)?

Answer

What you do should be enough in a perfect world. What might happen is that the structure under a GridNode, like sub nodes, gantt rows, layers, time items and their texts and links are not released because that we have missed to unlink them correctly. If I’m not misinformed you are still using the 1.3, and we do not add anything to this version. All the quality improvement goes into the 2.0 version

To make a long story short; To be safe make sure you null out focused cell, and focused time item for starters, then you should probably clear each layer of time items, each GanttRow of Layers etc….

 

Leave a Reply