10382 : Interactive DHTML control

Question

When are you planning to develop an interactive DHTML control that i can use in my websystem. To most important features i need is that i can add tasks to the gtp.net control, add a date selector or add a custom control to a column. If this is already possible in gtp.net please tell me how to do it.

thanks

Answer

The approach for a fully interactive Gantt is to incorporate the windows forms gantt in a soap-box on the client. This works very much like java-applets.

We could do a lot more with the Gantt_ASP component than we currently offer, however there are no closed doors in the current release. You can add html data to your cell values, and you could use this to add links to some or all cells. Such links could point out client side scripts, or postback to the server. You could react to these callbacks and change the html to add an input box in the clicked cell to handle inplace edit.

Of course it would be better if we already had done this for you, but sorry to say we have not.

Some interaction as zooming and panoration is available in the Gantt_ASP. Developers can easily add more interaction by implementing events and changing the rendered html. You have seen this sample right? http://www.plexityhide.nu/

10310 : Drag drop time items in GTP.NET

Question

I have done a treeview, which is internaly dragnable (in the grid area) to do some sorting. Now I would like to add the drag functionality to the timeitems the same way, with which I have very great difficulties. What is the best way to do such? (the examples Gantt_TimeItems and TimeDrag havent shown me the solution)

Answer

The dragging and dropping of time items are built in as core functionality. The sample TimeItemDragDrop show a more complex case of OLE dragging time items to a different control.

But dragging time items internally should be easy.

You can implement the event: gantt1_OnTimeItem_ChangeRow to react to a row switch, or gantt1_OnTimeItem_AfterMove to react to time axis move.

There are also properties in the timeItemLayout like AllowChangeRow that must be set to true (default).

 

10306 : How can TimeItem Move be Cancelled?

Question

Hello
How can TimeItem Move be Cancelled ?

example;
=============================
     TimeItem1 ——->TimeItem1
                     1. move
                              2. Check ? False
     TimeItem1 <——-
                     3.return to  Start Location
                 
——————————————–
Answer

In the public event TimeItemEvent OnTimeItem_Move();

You can make the check on the e.TimeItem.Start and e.TimeItem.Stop values if you add the e.Diff (this is the amount of move), then if you will not allow the move you can set e.Allow=false, or in this case, set e.Diff=0

 

 

 

10288 : Images in _some_ cells depending on other values

Question

Is it possible, based on a value in a cell, to have or not have an image in another cell on that row?
For example: I want to display a picture in the first cells of a row, but only when the second cell of that row is checked.

Answer

If you use the CellType.CustomCell and implement the OnCustomCellDraw event you can draw you image depending on values in any other cell. Use the argument e.Cell.Node to navigate to another cell in that row; e.Cell.Node.GetCell(2).Content.Value’

Sample code for CustomCellDraw:

private void grid1_OnCustomCellDraw(PlexityHide.GTP.Grid aGrid, PlexityHide.GTP.CustomCellEventArgs e)
{
  e.G.DrawArc(new Pen(Color.Red,3),e.DrawRect,0,180);
  e.G.DrawArc(new Pen(Color.Purple,3),e.DrawRect,180,180);
}

 

10282 : I do not want specific dates in the datescaler.

Question

is it possible to change the timeline using a counter of days/months/years instead of precise dates? for example my customers need to set zero at the beginning of the graph (start of their activities) then put bars x days/months/years from the beginning (this activity starts 5 days from the beginning of the plan, and is long 2 weeks, or this activity is to be done every month for one day each, etc).

Answer

You can simple a pick a start time (maybe a non leap-year) and keep this as your zero-point. Then you add your zero point to all time values when you show them (this can be done once and for all by implementing the OnBeforeDSToTimeItem event and the OnBeforeTimeItemToDS event if you are data-bound).

Then you want to implement the OnDateScalerDrawString event to change the textual output of the date scale markers to something less specific, like maybe “Month 1” instead of “January”.

You also need to implement the OnViewDateInformation to override the default span info presentation (this is the text normally found in the upper left corner)

10263 : Is there an easy way to rownumbers into a grid? This is easy when you only have rootnodes, but with a tree a becomes very complex…

Question

Is there an easy way to  rownumbers into a grid? This is easy when you only have rootnodes, but with a tree a becomes very complex…

Answer

There is no such functions built into the components but if you want to do a number of the style x.y.z for a root node of x, and a subnode of y and a sub-sub-node of z you can use a recursive strategy like this:


public string GetIdentityOfNode(GridNode aNode)
{
  if (aNode.ParentNode==null)
  {
     // this was a root node return the index
     return aNode.Index.ToString();
  }
  else
  {
     return GetIdentityOfNode(aNode.ParentNode)+"."+aNode.Index.ToString();
  }
}

10257 : OnBeforeEndEditCell need the content in the editor

Question

After editing a cell, I need to perform a check which cells are empty, so I need some kind of afterCellEdit event. I tried the ‘OnBeforeEndEditCell’-event, but it ignores the current cell, because the event fires before the end of the editing (doh…). Here’s my code:

    Private Function getLastRowInUse() As Integer
        Dim node As GridNode
        Dim lastNodeInUse As Integer = 0
        For Each node In grdTasks.RootNodes
            If node.GetCell(2).Content.Value <> “” Then
                lastNodeInUse = node.Index
            End If
        Next
        Return lastNodeInUse
    End Function

Answer

You  can keep this code but you also need to check the cell that is about to be applied.
This value can be obtained by inspecting the value in the editor.
So if the cell has a datetime picker you would do like this to check the value in the editor

   if (beforeEndEdit.Cell.Content is PlexityHide.GTP.TimeDate)
   {
     (beforeEndEdit.Cell.Content as TimeDate).DateTime…
   }

10291 : Elaborate on the time item text TimeItemTextLayout.OutsideText=true.

Question

There is a trick I would like to do, but I’m not sure what event would be best to do this in.

I have a gantt chart where there would be only one time item per row. The time item text shows up on the left-hand size of the time item (TimeItemTextLayout.OutsideText=true). When the user scrolls along the x axis (time) there would be some time items that would only be partially visible. In these cases you just see part of a time item and no text since the text is on the left of the time item.

In these cases, I would like to check for instances where the pixel width of the left-side text is partially obscured and then (for those time items that meet that criteria) do this:

TimeItemTextLayout.HorzAlign=StringAlignment.Far;

Its not a critical thing, but spit & polish make good applications great! 🙂

Answer

The TimeItemTexts are an easy way to display additional information in or around a time item. But if you need more advanced drawing that is dependent on additional parameters you should not be afraid of using the user drawn time items (TimeItemLayout.TimeItemStyle=TimeItemStyle.User;).

In this case you can implement the user draw for a time item, draw the default look of the time item with the TimeItemDraw class and draw the text exactly were you want it with standard GDI operations.

10235 : Printing is complex

Question

I m using your latest version in which you have given the support of Printing in X direction. By using your example I have successfully printed two pages in X direction but the question is that how someone would know in advance about the number of pages to be printed in X direction, I mean if one has set the scale in days then the time bars will become very long and let say if the scale is set in Quarters, then he might not need to print in x direction further.

My question is that why your print preview functionality is not so comprehensive that it could handle all the print related issues within itself. Why it is left for the developers?

It would be very helpfull if you could please tell us how to handle it easily?

Though we have found your product very valuable and we are really impressed by it But printing is the one area, which really needs to be improved.

Answer

The problem for us, as a supplier of a generic tool, is that we know even less regarding what your user may need. GTP.NET is currently used in applications showing only seconds and were dates have no meaning, and in applications showing years of information on overview screens. We can make no assumptions on what is important.

I agree that we can do a better job in helping you, the developer, out. But in the end you will still require the complete flexibility that our current solution offer.

I’m adding this to our todo list, thank you for the feedback.

10225 : GTP.NET deployment

Question

Hello, I’m evaluating Gantt controls for new project and one of the strong factors in decision is that deployment should be possible just by copying the needed files. I could not find this information on your site (search seems to return empty page without form). Can you please supply me with information about your component deployment.

Answer

You need to copy the PlexityHide.GTP.dll assembly along of with your application. If your solution has copyLocal=true in the reference for plexityHide.GTP this happens automatically and you have a true XCopy deployment of your application.