10688 : Critical path

Question

Does the phGantTimePackage and GTP.NET calculate the Critical Path?

Answer

WikiPedia on Critical path:

“The Critical Path Method, abbreviated CPM, is a mathematically based algorithm for scheduling a set of project activities. It is a very important tool for effective project management. It was developed in the 1950’s in a joint venture between DuPont Corporation and Remington Rand Corporation for managing plant maintenance projects. Today, it is commonly used with all forms of projects, including construction, software development, research projects, product development, engineering, plant maintenance, among others. Any project with interdependent activities can apply this method of scheduling.

The essential technique for using CPM is to construct a model of the project that includes the following:

A list of all activities required to complete the project,
The time (duration) that each activity will take to completion, and
The dependencies between the activities.
Using these values, CPM calculates the starting and ending times for each activity, determines which activities are critical to the completion of a project (called the critical path), and reveals those activities with “float time” (are less critical). In project management, a critical path is the sequence of project network activities with the longest overall duration, determining the shortest time possible to complete the project. Any delay of an activity on the critical path directly impacts the planned project completion date (i.e. there is no float on the critical path). A project can have several, parallel critical paths. An additional parallel path through the network with the total durations shorter than the critical path is called a sub-critical or non-critical path.”

Our components are used in many different types of applications and even when they are used for strict project planning it is common that multiple types of time items are used that symbolize different aspects of time. Planned time is only one aspect. Work time can be another (the actual performed work amount). And scheduled time can be a third (when the resource is available for any work at all).

So to simply say that we support a Critical Path analysis would not be correct. We do however support the harbouring of all the information needed to perform Critical Path calculations in what ever application you may build and this is what is important to us.

Critical Path calculation is to us only another domain specific usage of the information presented by the GTP.NET and the phGantTimePackage. You can easily go from one TimeItem to another over its timeItemLinks (relations) and you can easily add logic to iterate these paths and perform actions (like actually moving overlapping timeItems etc) or present bottlenecks by changing the presentation any way you may require (color, form and content).

 

10624 : The grid border style cannot be change when change to version 2.3.1.20 (GTP.Net)

Question

The grid border style cannot be change when change to version 2.3.1.20 (GTP.Net)

 

Answer

BorderStyle: The grid.BorderStyle demanded us to override the ControlParams. This is regarded as unsafe and was the last thing that stopped the entire GTP.NET to be regarded as a package of components that need no extra trust. We removed the Border implementation for this reason and we have currently no replacement for it. The gain was that you can embed the GTP.NET in a IE5 and IE6 and run a user control with zero trust (internet zone). Sample found here  http://www.plexityhide.nu/IEHostedGantt/Default.htm   (requires .NET 2.0 on client and late IE version).< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Sorry for the inconvenience…

 

To workaround this limitation you can implement the Grid.OnOffscreenPaintBackground event and draw a border yourself (normally the border requires the grid to be two pixels wider and two pixels higher and we have no workaround to facilitate this)

10620 : Drag in grid

Question

Can you tell me if it is possible to implement drag and drop of rows in the grid area?  I can’t see any built-in support but any advice would be much appreciated, we need to be able to drag rows within a “sibling” array and also between “parents”

Answer

You can do drag & drop. In the general download look for a sample called Gantt_GridDragDrop.

You need to start the drag in OnMouseDown, and decide what to do in OnDragDrop…


		Private Sub gantt1_OnGridMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
		  If Not gantt1.Grid.GridStructure.FocusedCell Is Nothing Then
			gantt1.Grid.StopRowResize()
			  gantt1.DoDragDrop(gantt1.Grid.GridStructure.FocusedCell.Content.Value.ToString(), DragDropEffects.All)
		  End If
		End Sub

		Private Sub gantt1_OnGridDragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs)
		  ' Drag drop events return screen coordinates. 
		  ' You must convert it to a Client coordinate before using it in GTP.NET
		  Dim localpoint As Point=gantt1.Grid.PointToClient(New Point(e.X,e.Y))
		  Dim cell As Cell=gantt1.Grid.GridStructure.CellFromXY(localpoint.X,localpoint.Y)
		  If Not cell Is Nothing AndAlso Not cell.Node.ParentNode Is Nothing AndAlso Not gantt1.Grid.GridStructure.FocusedCell Is Nothing Then
				gantt1.Grid.GridStructure.FocusedCell.Node.MoveNode(cell.Node.ParentNode,cell.Node.Index)
		  End If
		End Sub

		Private Sub gantt1_OnGridDragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs)
			If e.Data.GetDataPresent(DataFormats.Text) Then
				e.Effect = DragDropEffects.Move
			End If
		End Sub

		Private Sub gantt1_OnGridDragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs)

			If e.Data.GetDataPresent(DataFormats.Text) Then
				e.Effect = DragDropEffects.Move
			Else
				e.Effect = DragDropEffects.None
			End If
		End Sub

       	Private Sub PrepareEvents()

	  AddHandler gantt1.OnGridDragDrop, AddressOf gantt1_OnGridDragDrop
	  AddHandler gantt1.OnGridDragEnter, AddressOf gantt1_OnGridDragEnter
	  AddHandler gantt1.OnGridDragOver, AddressOf gantt1_OnGridDragOver
	  AddHandler gantt1.OnGridMouseDown, AddressOf gantt1_OnGridMouseDown

	End Sub


10602 : Multi page print with scaling in GTP.NET

Multi page print with scaling in GTP.NET

If you want to scale your print you can do that very easily by applying a scaleTransform to the Graphics object.

 

This sample looks very much like the other samples for multi page print, but this will use the scale 0.5 and will fit twice as much Gantt rows to a single page.

Using a scaletransform ensures that the fonts used get scaled along with all the other graphics.


    private void buttonPrintWithScaling_Click(object sender, EventArgs e)
    {
      try
      {
        // Assumes the default printer.
        PrintDocument pd = new PrintDocument();
        pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPageWithScaling);
        pd.BeginPrint += new PrintEventHandler(this.pd_BeginPrint);
        pd.EndPrint += new PrintEventHandler(this.pd_EndPrint);
        printPreviewDialog1.Document = pd;
        printPreviewDialog1.ShowDialog(this);

      }
      catch (Exception ex)
      {
        MessageBox.Show("An error occurred while printing", ex.ToString());
      }
    }

    private void pd_PrintPageWithScaling(object sender, PrintPageEventArgs e)
    {
       Rectangle r = new Rectangle(e.MarginBounds.Location, e.MarginBounds.Size);
       float scalingApplied = 0.5F; // Make it half size
       e.Graphics.ScaleTransform(scalingApplied, scalingApplied);
       // If it is half as big we get twice the space -> make the rect bigger
       r = new Rectangle((int)(r.X / scalingApplied), (int)(r.Y / scalingApplied), (int)(r.Width / scalingApplied), (int)(r.Height / scalingApplied));
       
       bool aHasMorePages=false;
       gantt1.PrintPage(e.Graphics, r, gantt1.GridWidth /* just as on screen */, gantt1.DateScalerHeight /* just as on screen */, ref aHasMorePages);
       e.HasMorePages=aHasMorePages;
       
     }

    public void pd_BeginPrint(object sender,   PrintEventArgs e)
    {
        gantt1.PrintInit(null);
    }
    
    public void pd_EndPrint(object sender,PrintEventArgs e)
    {
      gantt1.PrintEnd();
    }

10535 : Is it possible to get the edit windows (SingleEdit, DateTime, ComboText, etc) to appear in the middle of the cell?

Question

Is it possible to get the edit windows (SingleEdit, DateTime, ComboText, etc) to appear in the middle of the cell? My Cell layouts have their alignments to be
Horizontal: Center
Vertical: Center

When the edit starts, the editor appears top aligned with the cell, which can leave the cell text visible if the cell is taller than normal (eg capable of showing 3 lines of text)

Answer

From version 2.3.1.15  the CellLayout.VertAlign is taken into account when placing the DateTimePicker and the ComboBox. The SingleText edit looks at the CellLayout.HorzAlign

10483 : Scroll the grid programatically so that it moves one node at a time when the next node in the list is not visible?

Question

Is there a way to scroll the grid programatically such that it moves one node at a time when the next node in the list is not visible? I have been trying to use MakeSureVisible but its not completely accurate and it causes the scroll bar to jump by a large increment.

Answer

You can control the TopNode set in the Grid by setting the Gantt.Grid.Gridstructure.TopNode.

Also from the very latest release you can access the scrollbars with Gantt.Grid.ScrollbarNodes (returns a Scrollbar)

 

10479 : I use ontimeitem_userdraw to draw timeitems of custom shape. How do I make the mouse selection area match the custom shape of the timeitem?

Question

I use ontimeitem_userdraw to draw timeitems of custom shape.  How do I make the mouse selection area match the custom shape of the timeitem? 

Thanks

Answer

You implement the OnTimeItem_UserDrawBounds event, and return the e.BoundingRegion.

Nice to hear that you use these rather advanced details of the GTP.NET!

10369 : Capability to accept user events on the interface, like moving or creating task bars or editing parameters in web gantt.

Question

We’re developing a project management system, full-web, using a knowledge-based development platform, that can generate the programming code in C# or Java (among others). I mean, our system will be multi-platform… And we can integrate external components is this platform.

So, we’re looking for Gantt chart solutions, web enabled, to integrate to our software. One important aspect is the capability to accept user events on the interface, like moving or creating task bars or editing parameters.

How your solutions can met these problems?

Thansk in advance.

Answer

First: Our windows forms Gantt handles all thinkable user interaction events and then some.

About the Gantt_ASP for web deployment: Currently the Gantt_ASP is much restricted in drag and drop operations and other user interactions, we catch clicks to single time items or Gantt rows. These events can be used to bring up dialogs with information that the user can change with text boxes (developer work needed).

We do handle everything presentation wise, like zooming, scrolling, time item collision etc, but the web being such as it is we are restricted in user interactions.

The possibility to include a client side control is always there but that would require downloads and also probably restrict the supported browser.

10478 : I was wondering if there is a way too have the gantt row associated with the grid item highlight when its grid item is selected?

Question

I am currently trying an evaluation copy of your control. I was wondering if there is a way too have the gantt row associated with the grid item highlight when its grid item is selected?

Answer

There is no such automatic function, sorry. But the workaround (yes there is always a workaround) is to implement the OnTimeItemAreaPaintBackground, and simply draw something in the GanttRow rectangle that belongs to the GridNode currently selected.

The code below draws a red frame on the gantt row that is owned by the focused grid node…


    private void gantt1_OnTimeItemAreaPaintBackground(PlexityHide.GTP.OffscreenDraw aOffscreenDraw, PlexityHide.GTP.OffscreenDrawArgs e)
    {
      if (gantt1.Grid.GridStructure.FocusedCell!=null )
      {        
        Rectangle r=Gantt.GanttRowFromGridNode(gantt1.Grid.GridStructure.FocusedCell.Node).Rect();
        e.G.DrawRectangle(new Pen(Color.Red,3),r);
      }
    }

10455 : TimeItem made from images

Question

I want to create a timeline which taper like an arrow?
Can I select an Image for the middle part and one for the front and end part like some web site devolper tools?
I need a timeline like an arrow with pinnacles on both sides.    (For Example: <=======>; <=>; <==============================>)
Is it possible with GTP.Net?
Which size is optimal for the image?
And how does it works when I have a longer period?
In some web design tools I can choose a left and a right image and the middle part was draw/stretch for the period.

Answer

There is regretfully no out-of-the-box three image time item style (this is a good suggestion and we will remember this).

However if you choose “User” style on your time item and implement the OnTimeItem_UserDraw event you can easily implement this:

imageList1.Draw(e.G,e.Rect.X,e.Rect.Y,e.Rect.X+arrowWidth,e.Rect.Height,const_firstArrow);
imageList1.Draw(e.G,e.Rect.X+arrowWidth,e.Rect.Y,e.Rect.Width-2*arrowWidth,e.Rect.Height,const_middlepart);
imageList1.Draw(e.G,e.Rect.X+e.Rect.Width-arrowWidth,e.Rect.Y,arrowWidth,e.Rect.Height,const_secondArrow);

Its hard to give advise regarding the size; this pretty much depends on your design and the grid nodes row height that you want to use. If you are using variable row height etc.