10833 : How to obtain a runtime key for gtp.net?

Question

How to obtain a runtime key for gtp.net? Since my last update of gtp.net i’ve to call RegisterRuntimeKey…

Answer

You get the runtime key by visiting this page http://www.plexityhide.nu/runtimekeys/Default.aspx 

You must enter your serial number (CSGTPXXX) & your exe or assembly name.

The exe or assembly name to use is the name of your produced assembly or exe that will call Gantt.RegisterRuntimeKey or Gantt_ASP.RegisterRuntimekey.

Do you run a web-project without assemblies? Then you enter the dns name (for this site its plexityhide.nu) of your  deploy server instead.

You will get an automated email directly on completion of the form with the key + instructions on how to enter it into your application.

Need more hints on what to enter in the assembly name box? You can call gantt_Asp1.RuntimeKeyHelp or/and gantt1.RuntimeKeyHelp_Assembly to get the correct info for your application.

About runtime keys:

Call this early in your application to register the runtime key.
The runtime key is free for registered users and is obtained as described at http://www.plexityhide.nu/runtimekeys/Default.aspx 

The runtime key is unique per application, you can obtain as many runtime keys as you need.
The runtime key is NOT a runtime license, registered users have the license, the runtime key only removes the runtime plexityHide marking.

The main reasons for the introduction of runtime keys are:

#1 To Better understand customer applications and demands to guide us in further development
#2 To better track evaluation copies and important customer feedback
#3 To Protect customer investments from unfair competition from pirates
#4 Increase awareness of the plexityHide brand

 

Gotchas:
The key is compared with the application/assembly name in runtime so the key must be generated with the correct application/assembly name.

Call this in FormLoad for winforms:
Gantt.RegisterRuntimeKey(“THE RT KEY YOU GOT IN THE EMAIL”, “YOURKEY YOU GOT WHEN YOU BOUGHT GTP.NET”);
For ASP.NET you can choose to enter the url instead of the application name in the form (http://www.plexityhide.nu/runtimekeys/Default.aspx)


Or if you have the Gantt in an assembly, you can use the assembly name.

 

Just visit

http://www.plexityhide.nu/runtimekeys/Default.aspx and follow the instructions.

11039 : How to get the snapped time values in the Gantt1_OnTimeItem_StopValueResize event?

Question
 
I have a gantt chart/grid where I have set the start and stopsnap times. After I change the stop time of timeitem, the cooresponding column in the grid changes to the ‘snapped’ time.  How can I get this value to use instead of the true time from the Gantt1_OnTimeItem_StopValueResize event?

Trying: e.TimeItem.GanttRow.GridNode.GetCell(3).Content.Value
gives me the original stoptime of the timeitem and : Gantt1.FocusedTimeItem.Stop.Add(e.Diff).ToString
gives me the new stoptime w/out being snapped as indicated.

Thank you for your help.

Answer
 
The snapping is calculated after the OnTimeItem_StopValueResize event, but you can use the same logic we do to calculate the snapped value: Gantt.DateScaler.SnapTime(time,precision).
 
So try this:
TimeBeforeSnap=e.TimeItem.Stop.Add(e.Diff);
TimeAfterSnap=Gantt1.DateScaler.SnapTime(TimeBeforeSnap,e.TimeItem.TimeItemLayout.SnapStopTime);
 
 

10784 : Can you please tell me if there are events that I can listen to for when Grid Width changes and Grid gets sorted

Question

Hello. Can you please tell me if there are events that I can listen to for the following:

1) Grid Width changed
2) Grid sorted

Thanks!

Answer

When the grid width changes the Gantt.Grid.Resize event is fired. When a column is resized the OnColumnWidthChanged is fired

When the grid is sorted the OnUnBindedSort event will be called. If your Grid is databound the ApplySort or the IBindingList will be called and then it is up to your datasource to provide some event. GTP.NET does not currently fire any event before the ApplySort is called.

10787 : I want to host my UserControl with a Gantt in internet explorer and call it with javascript

< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />Question

I am trying to host my UserControl that contains a plexityhide Gantt in internet explorer. I cant get it to work and I get more or less zero feedback on what goes wrong so I am lost… Further more I want to call some stuff inside the UserControl with javascript once I get the thing to load….

 

Answer

Depending on the strict security context there are many mistakes to be made and Microsoft has chosen not to reveal security exceptions to the end user to make it harder for hackers.

 

In .NET 2.0 there are good tools to see security exceptions and you may just as well learn about them directly so that you can get stuff to work.

 

#1 You want to be able to call my UserControl from Javascript. To handle this your UserControl must be made COM-visible. Check the box in Project/properties/Assembly Information called “Make assembly Com-visible”.

 

#2 To smoke out all big and small security breaches that effectively stops your UserControl from being loaded go like this:

– Create a new windows form project

– Add your UserControl to it

– Choose Project/properties/Security on the new windowsform project. Check “Enable clickonce security settings”. Set “Zone your app is installed from” to “Internet” (or what you need).

– Now run the new winform app and behold all the minor and major stuff that gets caught by the security context. Like you cannot use SystemColors since that will need system access on the client. You cannot do this: Application.CurrentCulture = new System.Globalization.CultureInfo

And since you cannot set the culture you will get unexpected result from functions like decimal.Parse:

//HK decimal.Parse may not work since you may have the wring culture

//decimal num = decimal.Parse(Phase[“BudgetMoney”].ToString());

 Drag and drop requires extra permissions too

//gantt1.Grid.AllowDrop = true;   //HK Need UI-permissions

 

So either increase the security context by asking for more trust, or remove functionality…

 

10643 : Gantt_ASP temporary Images

Question

We’ve been using the GTP.net control for some month now. I have selected the option to store on the hardrive the temporary images. Now i’ve realized that the gantt always generated new image and never delete the old one. So in our directory we have now over 100 000 images. I was thinking to delete those images before the rendering of our pages but since this is a website, many users could at the same time on the same page so i cannot delete thoses images. So is there a way to delete the old images ? I’ve tried to not store the images on the hardrive but then all the timeitem are blank. I’m sure there is a solution since this control is for ASP.NET but i just can find how i must configure it to not have this problem.

Answer

The recommended approach is to use the cache and GTPImg.aspx page to deliver images to the client. We introduced the store on disk option to work around limitations in IIS experienced by one of our clients. And currently the Gantt_ASP does not clean up the temporary images.< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

If you delete all the temp images, the once that are needed will be recreated on the next fetch. I agree that it will be (slim) chance to disturb the user experience if you delete some images just when Gantt_ASP has checked that they exists but the client has not fetched them yet. If this happens it will show up as missing images, but it will be fixed in the next postback.

 

One solution could be this: Create the TemporaryImagesOnDiskPath with todays date in it. Create a new directory for each day. Write code in your page that creates the directory for today if it does not exists and set TemporaryImagesOnDiskPath to it. Write code that deletes two days old directories and its content if it exists.

 

If you delete two days old images your are safe.

 

 

10641 : Getting the time from a point

Question

I am using dragdrop to drop a ‘template’ onto the Gantt. From the OnTimeItemAreaDragOver event is it possible to find the date/time at the current cursor position? This then will be displayed in the ‘template’ image which is being displayed at the cursor point.

Answer

Sure, you use the Gantt.DateScaler.PixelToTime(x coord). Be sure to convert the coordinate to TimeItemArea local coords since the DragDrop events give you window coords:

Point localpoint=gantt1.TimeItemArea.PointToClient(new Point(e.X,e.Y));

10676 : Visual feedback on drag over

Question

I like to use Drag & Drop to reorder rows in a Grid. Do you have a Example or a Idee about the best way, to give the user a visual feedback about the possible insert point while moving the mouse over the rows in Drag-Mode?

MS Excel, for example, displays a horizontal line between the possible destinations if you drag rows.

Answer

I guess the standard way is to signal feedback by using the drop icon, and maybe have it changed if the drop means different things. Like in Explorer when a plus is drawn for copy and an arrow is shown for move.

If you want to do something in the grid upon dragover, you can simply collect all the necessary info in the DragOver event (cell, gridNode or what you have) keep this info in member variables, set a flag in a member variable stating that it is DragOverFeedBack-time. Call Grid.Refresh (forcing a redraw). An implement the OnGridPaintForeground to draw “something” on the grid to let the user understand what can happen once he lets go of the mouse.

Or you can simply change the CellLayout property of the effected cells within the DragOver event, to something that sticks out.

10623 : Getting the values out of the grid

Question

Hi Would you please help me to solve my problem. I am using your grid for for some other purpose as well, would you please tell me how to get the value of each cell of a selected row and assign to a variables so I can use those variable to save the data in the database

Answer

The easiest way to handle grid data is by databind, but you can set and add values directly to grid cells like this:

string data = GridNode.GetCell(theColumnIndex).Content.Value;

The Content property contains an object of type PlexityHide.GTP.TimeDate, PlexityHide.GTP.SingleText, PlexityHide.GTP.MultiText, PlexityHide.GTP.CustomCell, PlexityHide.GTP.ComboText or PlexityHide.GTP.BoolCheck depending on what kind of CellType you have set in the column.

 

10665 : How can I put an image (like the example in Yapp) in a TimeLine?

Question

How can I put an image (like the example in Yapp) in a TimeLine?

Answer

In phGantTimePackage you set the IphDataEntity_GantTime2.Style to gtsImage, uses the ImageIndex property to get a Image from the imagelist (same images as from the tree) . Or you can use a userdrawn time item and place an additional icon in there by normal GDI drawing.

In GTP.NET the TimeItemTextLayout has a property for ImageIndex. This enables you to place multiple icons in or outside of a time item.

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.