10662 : Does the GTP.NET provide a virtual load mechanism

Question

Does the GTP.NET provide a virtual load mechanism like the phGantTimePackage com edition does. Or What do I have to do if I want to add loads of nodes into the grid?

Is there any on demand mechanism to show the nodes in the grid.

Answer

The virtual load functions of the phGantTimePackage are currently not available in the GTP.NET. Sorry.

The GTP.NET does however support full databind, and you can add and remove rows to a dataset to load data into the grid on demand. It is not the same thing as Virtual load I agree.

 

10652 : Is it possible to extend the properties of a timeitem by adding custom properties?

Question

Is it possible to extend the properties of a timeitem by adding custom properties? Without the need of the source code? I’m thinking that maybe it could be done by using the userreference in some way?

Answer

Yes, that is what the UserReference is for. Put an object here and that object can have any properties you can think of. We will never touch UserReference so anything you put here is your own thing completly.

10622 : Time based content in TimeItems

Question

Hi, I would like to draw tick marks inside of a time item. I am using the “OnTimeItem_UserDraw” event and that works fine. An example might be that I would like to have a time item that is 10 minutes long and draw a tick every minute. So when I zoom in and out I the ticks would move around. Is there a way to do this? Perhaps there is a way to get the start and stop time of the region being drawn?

Answer

To draw accurate time based pixels in a user drawn time item you will need to use the DateScaler.PixelToTime and DateScaler.TimeToPixel function.
You can loop from your TimeItems.Start value to TimeItem.Stop. For every second you call DateScaler.TimeToPixel and draw a scale mark.

10553 : Is there a way to change the date scaler to show numbers from 0 to infinity with zooming functionality like you have except broken up by powers of 10?

Question

I would like to use your Gantt control in one of our projects, but our clock doesnt have units.  We have a discrete simulation product.  One of our object types is called a scenario event.  It has a start and stop time so it makes sense to have them edit via a gantt chart.  Is there a way to change the date scaler to show numbers from 0 to infinity with zooming functionality like you have except broken up by powers of 10?

Answer

You can implement the OnDateScalerPaintForeground event and use the time base from Start to Stop to create your own scale presentation. This is the standing recomendation for clients that need something we never thought of in the first place, and it should give you complete freedom of that design; on the other hand it gives you complete freedom to do the work as well 🙂

 

10544 : Height of the FishEye area in the DateScaler.

Question

Hi, is it possible to limit the height of the FishEye area in the DateScaler (for example to the two lower rows)? It looks not very nice when the DateInformation row is also colored with the FishEye color.

Answer

Currently there is no exposed property to control the height, but you can give the FishEyeColor the same color as the rest of the datescaler and then draw the background yourself in the DateScaler.OnOffscreenPaintBackground event.

10537 : How can I change the sequence to overlap the timeitem?

Question

 How can I change the sequence to overlap the timeitem? Now the timeitem that begins before is in top to the strip of the overlapped timeitem. Can I choose the order with that superimpose the item in case of collision ?

Answer

The CollisionDetection places early time items in the highest position. The way it does this is by assigning a non zero value to the SubCol property of the TimeItem object.

If the Owning GanttRow has SubColumns<>0 then the row is divided into sub rows (they are called sub columns for historic reasons and its a good name when the gantt is in the ScheduleMode) time items with a non zero value less or equal to GanttRow.EffectiveSubColumns will be draw in the sub row corresponding to that number.

So if you want to have the time items the other way around (early time items in a lower position) you can change the SubCol property after or in the OnCollisionDetect event.

10517 : GTP.Net Drag and drop

Question

I am using GTP.Net and I would like to ask is it possible to drag a time item to a control for example ListView? I want the time item to be able to move around (change start time) when the cursor is within the gantt chart. But if the time item is drag to the listview (or the mouse is drag to the listview), I need to pick up the time item text (which is being drag) and display it to the ListView and delete it (the time item being drag). Is it possible? Thanks a lot.

Answer

You want to switch from internal drag drop to “Normal” windows forms drag drop. No sweat.

In the code below we choose to cancel the started internal mouse move operation and instead start the Control drag drop.

We then treat another Gantt as a reciver, but this is where you should handle you listbox...

    private void gantt1_OnTimeItemAreaMouseDown_1(object sender, System.Windows.Forms.MouseEventArgs e)
    {
      this.richTextBox1.Text = "gantt1_OnTimeItemAreaMouseDown\n" + this.richTextBox1.Text;
      if (gantt1.TimeItemFromPoint(e.X,e.Y)!=null)
      {
        TimeItem thedraggedTimedItem=gantt1.TimeItemFromPoint(e.X,e.Y);
        gantt1.TimeItemArea.DoDragDrop(thedraggedTimedItem,DragDropEffects.All);
        gantt1.MouseMoveCancel();
      }
    }

    
    private void TimeItemArea_DragOver(object sender, DragEventArgs e)
    {
      if (e.Data.GetDataPresent(typeof(PlexityHide.GTP.TimeItem)))
      {
        e.Effect=DragDropEffects.All;
      }
    }

    private void TimeItemArea_DragDrop(object sender, DragEventArgs e)
    {
      this.richTextBox1.Text = "DROP\n" ;
      GanttRow gr=gantt2.GanttRowFromY(gantt2.TimeItemArea.PointToClient(new Point(0,e.Y)).Y);
      //GanttRow gr=null;
      //Cell c=gantt2.Grid.GridStructure.CellFromXY(0,e.Y);
      //if (c!=null)
       // gr=GanttRow.FromGridNode(c.Node);
      if (e.Data.GetDataPresent(typeof(PlexityHide.GTP.TimeItem)) && gr!=null)
      {
        TimeItem theOneToMove=e.Data.GetData(typeof(PlexityHide.GTP.TimeItem)) as TimeItem;
        TimeItem nti=gr.Layers[0].AddNewTimeItem();
        nti.Start=theOneToMove.Start;
        nti.Stop=theOneToMove.Stop;
        
      }
    }

  }

10860 : How can i set another color for the arrow while linking 2 activities?

Question

How can i set another color for the arrow while linking 2 activities (default is black) and also another width ?

Answer

Set these properties:

gantt1.TimeItemLinks.CreationTimeItemLinkWidth and
gantt1.TimeItemLinks.CreationTimeItemLinkColor