Snapping Objects in Gantt Chart
Details
Date:1/29/2009 5:42:43 PM
Product:ActiveGanttVB Scheduler Component
Framework:Visual Studio 6.0
Version:2.7.3
User's Development Environment:Visual Basic 6.0
Subject:Sorting/Compressing all tasks in a row
Question

I want to use ActiveGantt to do a production schedule.

How can I re-sort/compress the tasks on a timeline(row?) each time a user drags a task to a new position so that each task is tight against it's neighbor with no empty space (but also respecting non-moving items like breaks?

Also, I'd like the CompleteObjectMove to fire so I can keep the database in sync.

Answer

Answer:

If you take a look at the example in the demo (fProjectManagement01 - Graphical Project Management example) you will find that tasks fit tightly one against each other. This is because the the following code was used:


    ActiveGanttVBCtl1.CurrentViewObject.ClientArea.Grid.Interval = "1m"
    ActiveGanttVBCtl1.CurrentViewObject.ClientArea.Grid.VerticalLines = True
    ActiveGanttVBCtl1.CurrentViewObject.ClientArea.Grid.SnapToGrid = True

The grid.Interval setting can be adjusted so that it fits the level of zoom that you are using (ex: "1d", "1h", etc.) and the Grid.Vertical lines property can also bet set to false.

In order to see a clearer picture of ActiveGantt's ability to comunicate with databases please have a look at the Access database example in ActiveGanttVC (ActiveGanttVC not ActiveGanttVB), all databases (SQL Server, Access, etc.) are handled in much the same way.

 

All trademarks are property of their respective holders, and are only used to directly describe the products and services being provided. Their use in no way indicates any relationship or endorsement between The Source Code Store LLC and the holders of said trademarks.