10313 : I have Start and Stop date values in the grid that I want to update when a time item changes.

Question

I do some acutalizations of values in my grid with these event handlers, but OnTimeItem_StartValueResize and
OnTimeItem_StopValueResize are never called?

MainGantt.OnTimeItem_AfterMove        += new TimeItemEvent(MainGanttTimeItemManipulation);
MainGantt.OnTimeItem_StartValueResize += new  TimeItemEvent(MainGanttTimeItemManipulation);
MainGantt.OnTimeItem_StopValueResize  += new  TimeItemEvent(MainGanttTimeItemManipulation);

If found Entry Q10044 – FAQ: StartValueResize, but you didn’t answer the concerns that said “but for some reason it wont work” and gave a  workarround for this special case?

Answer

(Andreas sent me a sample to work with because I could not repeat this problem)

I changed the code you had in your sample to this:

        void MainGanttTimeItemManipulation(Gantt aGantt, TimeItemEventArgs e)
        {
            if (DragStartedAtCell != null)
            {
                GridNode TimeItemsNode = e.TimeItem.GanttRow.GridNode;
                if (MainGantt.MouseMoveKind == MouseMoveKind.resizee || MainGantt.MouseMoveKind == MouseMoveKind.move )
                {
                    TimeItemsNode.GetCell(3).Content.Value = e.TimeItem.Stop.Add(e.Diff);
                }
                if (MainGantt.MouseMoveKind == MouseMoveKind.resizew || MainGantt.MouseMoveKind == MouseMoveKind.move)
                {
                    TimeItemsNode.GetCell(2).Content.Value = e.TimeItem.Start.Add(e.Diff);
                }
                                }
            }
        }

So what the new code does is:

#1 check if what kind of move-op it is and decide if we need to update any or both cells (Start and Stop)
#2 If we shall update we update with the value compensated with the Difference that is about to be applied (.Add(e.Diff));

 

10258 : I have Download the sample web Apps but I can not seem to be able to open any of the solution ib VS 2003

Question

I have downloaded the GTP.net Trial,  and Download it the sample web Apps from https://plexityhide.com/pub/SamplesWEB_Converted_VB.NET.zip

but I can not seem to be able to open any of the solution ib VS 2003,  any suggession ?

Answer

What happens then? If you get it opened and check the references section of the solution do you have any not found assemblies? If so remove those and browse for them and add them again.

It is also a little bit tricky to “convert” a downloaded folder struture to a web-application in VS2003, the new folder must be known by your webserver. One trick is to create a new web-application, then move over the files to that folder….

10227 : Click in the datescaler?

Question

how can I specific boxes (e.g. one day/week/month/year) of the DateScaler become to be selectable?

Answer

There is currently no such specific events in GTP.NET but you can simply add on the standard OnClick events of the DateScaler, and convert the mouse X position to datetime with PixelToTime function to calculate where (on what month etc) the user clicked.

10218 : Every time I double click a cell the cell goes into edit mode…

Question

I am evaluating the GTP .NET product and I am trying to create a gantt chart from data already in a sql table.

I want to be able to bring up a properties dialog box when double clicking on the grid, the box should show details of the row I double clicked. I am having problems implementing this because every time I double click a cell the cell goes into edit mode and the grid double click is not fired.

How can I achieve this?

Answer

If you have no need to edit cells; Set the GridColumns[x].Readonly=true.

If you want to allow edit, but not from double click, you can implement the OnGridMouseDown event, and set the GridColumn in question to readonly and then set it back to readonly=false, in the OnGridMouseUp.

It feels somewhat like a bug that the doubleclick is not called at all… Can you send us a repeating sample on this issue we would appreciate it… (email samples to support@plexityhidemainsite.azurewebsites.net)

10189 : What is your licensing concept?

Question

What is your licensing concept? Does using GTP.net on my desktop computer and on my laptop means that I have to purchase two licenses?

Answer

We license the GTP.NET per developer seat. You are one developer, and you probably have a couple of machines, OK, one license.
Maybe you need it on the build machine as well. Still ok with the one developer license.

Your peer want to use GTP.NET too, he will need a license of his own.

You distribute you application to millions of clients. We are happy for you. No Runtime costs, no hidden costs. We are developers and we know that RT-fees can be the biggest turn off in the world.

10180 : I have a need to put a Gant chart in a report generated by SQL Server Reporting Services.

Question

I have a need to put a Gant chart in a report generated by SQL Server Reporting Services.

Can I do this with your controls and will I have to write code around it or can I latch it directly onto a view in the database?

Answer

You will need to write some code to define the datasources and the presentation settings.  You also need to wite some code to produce the printout, controlling the printed view, page breaks and any additional header and footer you might want in there…

There are samples decsribing all of these things both in c# and VB.NET in the general download

10374 : Print to a bitmap

Question

I would like to enhance the print functionality for GTP. I’d like the productvery much , only the print functionality is a bit poor.

My question is how to obtain the image that is been posed on the printpreview. When a print preview is genarated I can only find information about the graphics object but not the image:

System.Void PrintPage ( System.Drawing.Graphics G, System.Drawing.Rectangle Margins, System.Int32 aGridWidth, System.Int32 aDateScalerHeight, System.Boolean& HasMorePages)

I noticed that there are images(bitmaps) for the grid and datescalar but I’m looking for one image object of the complete gtp (grid + datescalar). Can you please give me some information for my problem?

Answer

You can send in a graphics object that comes from a bitmap like this:

Bitmap b=new Bitmap(w,h);
Graphics g=Graphics.FromImage(b);

And the call PrintPage with that… You will then get the complete print in bitmap!

Sample code:


    // Print to a bitmap file
    Bitmap bm=new Bitmap(CapTimingGantt.Gantt.Width, CapTimingGantt.Gantt.Height);
    Graphics g = Graphics.FromImage(bm);
    g.FillRectangle(new SolidBrush(Color.Tomato), r);
    g.DrawRectangle(Pens.Black, r);
    bool hasMorePages = false;
    Rectangle r = Rectangle.FromLTRB(0, 0, CapTimingGantt.Gantt.Width, CapTimingGantt.Gantt.Height);
    CapTimingGantt.Gantt.PrintInit(null);
    CapTimingGantt.Gantt.PrintPage(g, r, 150, 28, ref hasMorePages);
    CapTimingGantt.Gantt.PrintEnd();
    bm.Save("c:\\temp\\test2.bmp");

 

To print to an EMF instead go like this:


    // Print to emf, enhanced meta file, the windows vector format
    Graphics g = CapTimingGantt.Gantt.CreateGraphics();
    IntPtr pHdc = g.GetHdc();
    Metafile mf = new Metafile("c:\\temp\\test2.emf", pHdc);
    g.ReleaseHdc(pHdc);
    g.Dispose();
    g = Graphics.FromImage(mf);
    bool hasMorePages = false;
       
    Rectangle r = Rectangle.FromLTRB(0, 0, CapTimingGantt.Gantt.Width, CapTimingGantt.Gantt.Height);
    g.FillRectangle(new SolidBrush(Color.Tomato),r);
    g.DrawRectangle(Pens.Black, r);
    CapTimingGantt.Gantt.PrintInit(null);
    CapTimingGantt.Gantt.PrintPage(g, r, 150, 28, ref hasMorePages);
    CapTimingGantt.Gantt.PrintEnd();
   
    g.Dispose();

 

We also get questions on how to print a bitmap that is larger than what is on screen.

And this is ofcourse totally analouge, just create a larger bitmap and a larger rectangle...

 

 

 

// Print to a bitmap file

Bitmap bm = new Bitmap(gantt1.Width*10, gantt1.Height*3);

Graphics g = Graphics.FromImage(bm);

Rectangle r = Rectangle.FromLTRB(0, 0, gantt1.Width * 10, gantt1.Height * 3);

bool hasMorePages = false;

gantt1.PrintInit(null);

gantt1.PrintPage(g, r, 150, 28, ref hasMorePages);

gantt1.PrintEnd();

bm.Save("c:\\temp\\test2.bmp");

pictureBoxImageMaps.Image = bm;

 
 
Further note: When printing from a webpage and you use collisiondetection the print sequence should look like this:

      Gantt_ASP1.Gantt.TurnOffAllCollisionDetect=false;   <---  ADD THIS< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

      Gantt_ASP1.Gantt.PrintInit(null);

      Gantt_ASP1.Gantt.PrintPage(g, r, 150, 28, ref hasMorePages);

      Gantt_ASP1.Gantt.PrintEnd();