10644 : Im evaluating GTP.NET and YAPP, could you tell me whta is the relation between the two products?

Question

I’m evaluating GTP.NET and YAPP, could you tell me what is the relation between the two products? Can projects created in yapp be opened using GTP?

Answer

Yapp was made using the phGantTimePackage. Yapp is a standalone application that uses many of the features available in the phGantTimePackage. When .net was released we constructed GTP.NET, that stands for GanttTimePackage.Net. Now GTP.NET is a, fully managed, potent component package that in many ways surpass the phGantTimePackage.

Yapp uses a simple xml format to persist the objects within. This format could easily be interperted and read by your code to show the same data in the GTP.NET, but there are no such functions built into the GTP.NET package.

10600 : Making sure the Gantt is not expanded after load

Question

I am using GTP.NET 2.3.1.
I fill my Gantt with DataBinding on several DataTables. This I’m doing in CGantt_OnNodeInserted(..).
I have Root_Nodes und Sub_Notes in my grid.
I’m tying to set
e.GridNode.Expanded = false;
or
//e.GridNode.Expand(false,true);
at the end of this Event-Handler.
But all my rows are expanded when I see the ganttchart for the first time.
What can I do that the tree is for the first view not expanded.
I have defined a button to expand or collapse my view, this is working fine.
What can I do ?
Is there a event that fires when all gridnodes are created before the gantt is shown ?

Answer

It is better to check if this new node is a child node, and if so to fold the parent.

if (e.GridNode.Parent!=null)
{
   e.GridNode.Parent.Expanded=false;
}

 

10523 : The TimeItem Rectangle

Question

I have userdrawn timeitems that are smaller (shorter in height) than the standard timeitem rectangle (rect). When connecting timeitemlinks, the links attach below the userdrawn timeitem. How do I force the rect dimensions to the same or similar dimensions of the userdrawn timeitem so that timeitemlink attach directly to the timeitem? Thanks

Answer

You can control the “thickness” of a time item by setting the Inset properties of the TimeItemLayout. BottomInset  and TopInset. These values are given in percent, so to make the time item rectangle 10 percent thinner from the top you would set TimeItemLayout.TopInset=10, and to shave 10 percent of the original height from the bottom you set TimeItemLayout.BottomInset=10.

 

 

10593 : How do I obtain the (Grid) Node that was double-clicked?

Question

How do I obtain the (Grid) Node that was double-clicked?

I’ve tried a few things including:

 void GanttView_OnGridDoubleClick(object sender, EventArgs e)
    {
      Point p = PointToClient(MousePosition);
      Cell c = this.Grid.GridStructure.CellFromXY(p.X,p.Y);
      if (c != null)
      {
      }
  
    }

The cell returned is always null, I have a double-click handler on the timeitemarea and I’m able to locate the correct TimeItem no problem..

Answer

Your code is correct but the PointToClient translates to Gantt-coords and not grid coords. change to this:

      Point p = this.Grid.PointToClient(MousePosition);

10491 : How can I specify the text color of a selected cell?

Question

I have a question concerning the CellLayouts class.

How can I specify the text color of a selected cell? I miss a SelectedFontColor property in the CellLayouts class. There are BackgroundColor, SelectedColor and FontColor however the text color of a selected cell is always white.

Answer

Correct. This is something of an oversight. Based on your finding we added a new property to CellLayout called FontColorSelected that controls the font color on a selected cell.

Please contact support if you need this update asap (we have it in the lab). Also please state if you use VS2005 or 2003.

 

10498 : Gantt_ASP interaction

Question

I’m working with GTP.NET for ASP.NET10 trial version, which I downloaded directly from your site. I’m trying to enable both the horizontally drag&drop and the resizing of a timeitem, but when I click on the timeitem, the gantt is only refreshed and nothing remains selected.

Furthermore, if I try to move a timeitem (holding the left-click and moving the mouse), the “unavailable pointer” sing appears, and the gantt doesn’t do nothing (it doesn’t even do the refresh).

I also attached events for “OnTimeItem_BeforeMove” and “OnTimeItem_AfterMove”, but the only event intercepted is the “OnTimeItem_ClientClick”

How can I enable drag&drop?

Please note that I almost copied the code from the help downloaded from your site.

Answer

Many of the interaction events from windows forms are disabled in Gantt_ASP. The Gantt_ASP produces strict html and uses postbacks to handle user events. To get full interaction you need to include the windows forms assembly in your web page. Or you can bring up new windows and get text information from the user on new values for a time item etc (this you need to do yourself).

We are working on an Ajax enabled Gantt wrapper that will give you some user interaction without postbacks but this is not finished (no date).

10471 : Scrolling faster

Question

Instead of panning left and right a little bit at a time, I want one click on the pan buttons to move forward the distance X where X = gantt.datescaler.stop – gantt.datescaler.start.
In other words, if your current zoom level is showing 2 days, I want a click on one of those buttons to move forward another two days.

Thanks!

Answer

Go like this:


    private void buttonJumpLongerInScroll_Click(object sender, System.EventArgs e)
    {
     
      gantt1.DateScaler.OnBeforeScaleOrSpanChange+=new BeforeScaleOrSpanChangeEventHandler(DateScaler_OnBeforeScaleOrSpanChange);

    }
    
    private void DateScaler_OnBeforeScaleOrSpanChange(DateScaler dateScaler, BeforeScaleOrSpanChangeArgs e)
    {
      if (!e.IsZoom)
      {
        TimeSpan jumptime=dateScaler.StopTime.Subtract(dateScaler.StartTime);
        if (e.NewStartTime<dateScaler.StartTime)
        {
          e.NewStartTime=dateScaler.StartTime.Subtract(jumptime);
          e.NewStopTime=dateScaler.StopTime.Subtract(jumptime);
        }
        else
        {
          e.NewStartTime=dateScaler.StartTime.Add(jumptime);
          e.NewStopTime=dateScaler.StopTime.Add(jumptime);
        
        }
      }
    }

10481 : Is there a way to get the current resolution of the DateScaler?

Question

Is there a way to get the current resolution of the DateScaler? I found the Resolution parameter in the OnDateScalerDrawString event but how can I get the Resolution value without using a member variable?

Answer

In the latest service release we have added two new properties; BackgroundScaleFactor and FishEyeScaleFactor exposed on the Gantt.DateScaler to give access to this information.

10388 : Im interested in having some read only time items in a gantt.

Question

I’m interested in having some read only time items in a gantt. These time items are only there to show aggregate data (the total number of hours worked per employee). I don’t want the user to be able to modify them or select them on the gantt. When the user’s mouse hovers over these time items I don’t even want the mouse cursor to change into a hand.

I saw the suggestions in this article:

http://plexityhide.dyndns.org/InstantKB13/Article.aspx?id=10026

Unfortunately, the items are still selectable and the mouse cursor acts as if they are movable items.

Ideally, I’d like to draw information on the “background” of the gantt row at the beginning of each week which states the total number of hours worked for that user for the week. How I was going to accomplish this was adding another layer to the gantt which was databound to a rollup table I calculate which contains this data.

Is there a better way which you would recommend I use to achieve the desired effect?

Answer

To get information into the background that is truly “dead” and allows no interaction I suggest that you implement the OnTimeItemAreaPaintBackground event as described in this article: http://plexityhide.dyndns.org/InstantKB13/Article.aspx?id=10066

You can use the Gantt.DateScaler.TimeToPixel method to translate a time to an exact pixel position so that you place your info on the exact correct place.