Auto row scrolling

When you drag a time item outside of the screen – in the time direction – you auto scroll in time. But when dragging the time item out of screen to the top or bottom we should auto scroll rows.

This needs a new event since we are not really sure exactly how the Gantt Rows are grouped to form a Gantt chart – you can use any control like a DataGrid or a ListView to group the rows.

This is one example of how to implement row scrolling with the new event:

    private void _GanttControl_OnConsiderRowAutoScroll(object sender, OnConsiderRowAutoScrollArgs e)
      var trans= e.TimeItem.TransformToVisual(_GanttControl);
      var posInGanttCoords = trans.Transform(new Point(0, 0));
      if (posInGanttCoords.Y < _GanttControl.DateScaler.ActualHeight)
        // scroll up
        ControlTemplate template = this._ItemsControl.Template;
        ScrollViewer scrollViewer = (ScrollViewer)template.FindName("_ScrollViewer", this._ItemsControl);
        e.ScrollDoneReMeassure = true;

      if (posInGanttCoords.Y > _GanttControl.ActualHeight)
        //scroll down
        ControlTemplate template = this._ItemsControl.Template;
        ScrollViewer scrollViewer = (ScrollViewer)template.FindName("_ScrollViewer", this._ItemsControl);
        e.ScrollDoneReMeassure = true;



In this particular case the Gantt is held in a ItemsControl that has a scrollviewer that has the name of _ScrollViewer. So the new Event OnConsiderRowAutoScroll is called whenever the TimeItem is dragged of the GanttRow.

Then we need to check if the TimeItem should initiate an AutoScroll – and if it does we need to scroll and set the flag e.ScrollDoneReMeassure=true – this way the Gantt knows that the worlds has changed.


How are images delivered to the Gantt_ASP

Gantt_ASP uses generated images to build up the view.

The images used to come from an aspx page called GTPImg.aspx

This is no longer the case. Instead images are served up by a handler called GetImage.ashx.

Handlers are defined in the config file. The old developer server (before IIS Express) had a different way to define the handler.

Check the config file below if you have any problems to get images to show.


<?xml version="1.0" encoding="utf-8"?>
    <!-- this section needed for iis7-->
      <add name="GetImage" verb="*" path="GetImage.ashx" 
type="PlexityHide.GTP.WEB.GetImage, PlexityHide.GTP.WEB" /> </handlers> </system.webServer> <appSettings /> <connectionStrings /> <system.web> <!-- this section needed for developer server <httpHandlers> <add verb="*" path="GetImage.ashx" type="PlexityHide.GTP.WEB.GetImage, PlexityHide.GTP.WEB" /> </httpHandlers> -->

GTP.NET 6 – 2015

Summary of recent news in GTP.NET

When TimeScrollUse is true a scrollbar is added to allow scroll in time from TimeScrollMinDate to TimeScrollMaxDate


TimeItemStyle.RowHeightScale – To better facilitate use of screen space and time precision a new time item drawing style has been added.
In this style the drawing is divided into multiple rectangles – one per lower scale band – and the end parts are drawn as a schedule – both for start and end.
This allows users to have greater precision on move and resize:



Gantt_ASP now use handler to serve up images and deals with error that IE10 & 11 use doubles as coordinates where as Chrome and FF use integers


RightToLeft support for the whole Gantt including Grid and Printing:


Runtime key–to remove runtime marking from GTP.NET

When you run newer versions of GTP.NET you get a button in the date scaler:


To remove this button from your production system you need a runtime key.

Runtime keys are free for registered users of GTP.NET.

This is how you create a runtime key

Visit this site:

Find the runtime key menu:


Enter you key – choose product (GTP.NET) – Generate key – copy the resulting key


In your application code do something like this – do this BEFORE component creation. You only need to do it once per application:

        public WinForm()
            RuntimeKey.Check.Register("YOUR-GTPNET-KEY==", "THE LONG GENERATED KEY FROM ABOVE =");


FAQ: But why? It is not fair that some use the GTP.NET without sharing the cost of maintenance.
The runtime key makes it easier for all users to remember to acquire a license and help share the cost of maintenance.

Limit TimeItem change to whole days

        private void gantt1_OnTimeItem_Hoover(PlexityHide.GTP.Gantt aGantt, PlexityHide.GTP.TimeItemEventArgs e)
            if (aGantt.MouseMoveKind == MouseMoveKind.move)
                textBoxEvents.Text = "Moving a time item";
                DateTime suggestedStart=gantt1.DateScaler.PixelToTime(e.x);
                // but we do not accept the suggested start - we want it to differ in complete days...
                double totaldays=Math.Round((e.TimeItem.Start - gantt1.DateScaler.PixelToTime(e.x)).TotalDays);
                e.x = gantt1.DateScaler.TimeToPixel(e.TimeItem.Start - new TimeSpan((int)totaldays,0,0,0));

Problems with Gantt_ASP Ajax

In IE10 and IE11 the coordinate system is all of a sudden in float numbers and not in integer as in all other browsers.

The AjaxControlToolkit has a GetElementPosition call deep down in it Common namespace that does some error checking.

The error checking it does is partly to verify that the coordinates it gets is of type integer – in IE10 and IE11 the will not be integers. Hence exceptions.

The error checking is only in effect when you have the scriptmanager in debug mode.

So to fix the errors you must do this:

          <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server" 
CombineScripts="False" ScriptMode="Release"> <Scripts> <asp:ScriptReference Name="Common.Common.js" Assembly="AjaxControlToolkit" /> <asp:ScriptReference Name="Compat.DragDrop.DragDropScripts.js" Assembly="AjaxControlToolkit" /> <asp:ScriptReference Name="PlexityHideAjax.Gantt_AjaxBehavior.js" Assembly="PlexityHideAjax" /> </Scripts> </asp:ToolkitScriptManager>


Once you have done this – the moving of time items from client side works just fine once again.