10513 : Interactive Web control

Question

I want to make a web based application so that we can make booking of a car in the gantt chart and that chart should be database driven.When we want to change the booking we should be able to work from the chart itself,so that we can drag and change the colour bars.Will it be possible?How much will it cost?

Answer

Interactivity on the web is hard. You have three major paths to chose from:

1. Integrate the windows forms control into IE. This is the similair to how ClickOnce applications work.

2. use a basic html compliant solution with Gantt_ASP

3. Use a lot of client side java script functionality in the browser and get info from the server asynchrounsly. aka Ajax.

Pros and cons:

1. pros: full interaction, you can use .NET and high level languages to develop your stuff
1. cons: it works in IE (96% of all browsers), it does not work on Mac/Linux

2. pros: works everywhere even on java enabled browser phones and wireless devices
2. cons: html basically sucks big time on interactivity. You need to work with server postbacks and bring up dialogs to change and update the information

3. pros: You may get what you are looking for in parts of better interactivity, and you can get it to work on all major browsers
3. cons: your solution code is partly in the browser and partly on the server. Your environment has gone from crisp clear to very complex.

Solution 1, and 2 you can start with today with GTP.NET, it will cost you one developer seat license per developer that will work with this part of the system -> good price.

We are very intrested with solution number 3 as well and we are looking into the microsoft approach Atlas to handle Ajax implementations. This is not done, and we have no real good ETA.

 

 

10518 : Is there a way to catch the undo of a CollisionDetect?

Question

I’m working with GTP.NET in visual studio 2005, C#.

In OnCollisionDetect I set the layout of the TimeItems to a layout with a red background.
Is there a way to catch the undo of a CollisionDetect?

So I can change back the settings at the moment a collision is being aborted?

thanks in advance,

Answer

You should use the new functions that extend collisionDetect called ConflictAreas. These give you better control on when they occur and when they are solved. 

    private void gantt1_OnConflictArea_Update(PlexityHide.GTP.Gantt aGantt, PlexityHide.GTP.ConflictArea_UpdateArgs e)
    {
      string aEventDesc=“TimeItem “+e.ConflictArea.OwningTimeItem.Index.ToString();
      if (e.ConflictAreaUpdateKind==ConflictAreaUpdateKind.add)
        aEventDesc+=” has new conflict with “+e.ConflictArea.ConflictingTimeItem.Index.ToString();
      if (e.ConflictAreaUpdateKind==ConflictAreaUpdateKind.update)
        aEventDesc+=” still in conflict with “+e.ConflictArea.ConflictingTimeItem.Index.ToString();
      if (e.ConflictAreaUpdateKind==ConflictAreaUpdateKind.remove)
        aEventDesc+=” has resolved conflict with “+e.ConflictArea.ConflictingTimeItem.Index.ToString();
      textBox1.Text+=“\r\n “+aEventDesc;   
    }
 

 

 

10443 : Shade only the overlapping area with a pattern?

Question

If two or more timeitems are overlapped, am I able to shade only the overlapping area with a pattern? Or is there any other way I can show graphically that there is an overlap occuring? At the overlapping area, am I able to obtain the timeitem information for all overlapping items when double clicking or right clicking?

Answer

We are currently doing client specific adjustments to handle just this scenario. We are adding a new class called ConflictArea and it will be reachable from TimeItem.

The ordering client will get this functionality in January 2006; it will then be made available to other licensed users.

 

10456 : Rotated text

Question

Hi,We are using GTP licensed product (GTP.NET, version is 2.0.14) in our application.
We now need the Column Text(Title) to be render on some given angle (0-270 Degrees)
Is it possible to Rotate Column Text on some angle?

Thanks

Answer

Currently there is no property in the CellLayout to control the angle of text. You will need to use a CellType.CustomCell in the header.

Implement the Grid.OnCellTypeChoose event, return e.TypeToGiveNewCell=CellType.CustomCell for header cells (Cell.Node==null for header cells)

Then implement OnCustomCellDraw and use standard GDI calls to do the drawing…

10428 : Export format and Copy Paste

Question

I m using latest GTP.Net Version.
Do you have any support available to export the grids data to MS Excel or any other application?

Can we copy some cells (i.e. its data) from the grids and paste the ed data to somewhere else?
I ed some cells and tried Ctrl+C to see if its copy something or not, But it wasnt working, why?

Answer

We currently do not have any built in conversion. You will need to iterate the Gantt and build the export format you need yourself.

Concearning Copy and Paste to grid cells; this functionality has been added in the latest service release (2.2.3.0 and is currently available for download here https://plexityhide.com/pub/PlexityHide.GTP.zip)

10442 : Changing single Cells font color based on a rule

Question

I have a procedure that fills timeItems in the dateScaler (from dataset)…

private void fillGridItems…
for (int i=0; i<dsEmployees.Tables[“person”].Rows.Count; ++i)

GridNode gn=gantt1.Grid.GridStructure.RootNodes.AddNode();
gn.GetCell(0).Content.Value=”first_name”;

.
.
GanttRow gr = GanttRow.FromGridNode(gn);

TimeItem ti1=gr.Layers[0].AddNewTimeItem();

.
.

After filling all items, user can click on date scaler and insert new time items. (add new rows in the same dataset) My question is…i’m counting how many time items every employee has for every day. If that number > 9, I would like FontColor in the grid for that employee to be Color.Red.

I was trying something like this

gantt1.Grid.GridStructure.RootNodes[0].GetCell(0).Layout.CellLayouts[0].Font
Color=Color.Red; – every employee is red

gantt1.Grid.GridStructure.RootNodes[0].Nodes.Columns[0].ColumnCell.Layout.Fo
ntColor=Color.Red; – every employee is red

gantt1.Grid.GridStructure.RootNodes[0].Nodes.Columns[0].ColumnCell.Layout=ga
ntt1.Grid.CellLayouts.GetFromName(“layout”); – makes no change

when I fill items from the database I can reference the column with
gn.GetCell(0) and then the value for that cell.
Why I can not call only one column…

i want to avoid calling the same procedure (fillGridItems) and making cell.layout and then adding to cell.layouts … if it is possible only change the color of the text in the grid

Answer

The CellLayout is used by multiple cells.

One way to reach your desired result is to create a new CellLayout for each cell like this
                        CellLayout cl=GetCell(0).Layout.Clone() as CellLayout;
                        GetCell(0).Layout=cl;
                        cl.Font.Color=Color.Red;

Or why not add your needed celllayouts in design time to the Gantt.CellLayouts collection and then in runtime assign the correct one like this

                        GetCell(0).Layout = Gantt.CellLayouts.GetFromName(“OverWorked”);

 

10427 : Selected cells show in print

Question

I m using latest GTP.Net Version and I m facing a problem.
If we have ed some cells in the Grid and we take the Print Preview, then these ions are visible in Print Preview as well. Which is not right.
Is there any solution to avoid that ion being shown on Print Preview?

Answer

Thanks for reporting this bug. Assemblies with this bug fixed is available here:
https://plexityhide.com/pub/PlexityHide.GTP.WEB.zip and https://plexityhide.com/pub/PlexityHide.GTP.CLR20.zip

 

10779 : Cannot click image with zero length

Question

I need to select a time item TimeItemStyle=image with the click mouse but the time item start and finish is equal.

No action on image

Answer

This is what we call a FixedSize time item, it has no length and is common in milestones etc.

In GTP.NET you set FixedSizeUse to true and FixedSize to a pixel value in the time item layout.

In phGantTimePackage you set IphDataEntity_GantTime2.FixedSize to the pixel value you need

11340 : Printing from a web page

Question

I want to print the gantt shown on a webpage.

Answer

You will need to perform the rending server side. The general idea is the same as explained in this article https://plexityhide.com/faqs_gen_GTPNET/10374.htm.

To be more precise this is how it is done if you want the result to returned as jpeg:

     protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Bitmap bm = new Bitmap(Gantt_ASP1.Gantt.Width, 300 + Gantt_ASP1.Gantt.DateScalerHeight);
        Graphics g = Graphics.FromImage(bm);
        Rectangle r = Rectangle.FromLTRB(0, 0, Gantt_ASP1.Gantt.Width, 300 + Gantt_ASP1.Gantt.DateScalerHeight);
        g.FillRectangle(Brushes.White, r);
        bool hasMorePages = false;

        Gantt_ASP1.Gantt.PrintInit(null);
        Gantt_ASP1.Gantt.PrintPage(g, r, Gantt_ASP1.Gantt.GridWidth + 10, Gantt_ASP1.Gantt.DateScalerHeight, ref hasMorePages);
        Gantt_ASP1.Gantt.PrintEnd();

        Response.Clear();
        Response.ContentType = “image/jpeg”;
        Response.AddHeader(“Content-Disposition”, “attachment; filename=GanttASP.jpeg”);
        bm.Save(Response.OutputStream, ImageFormat.Jpeg);
        Response.End();
        bm.Dispose();
        g.Dispose();
    }

If you want to to pdf or something like that, the basic principle applies, but you will need an additional tool to render the pdf.

10813 : Is it possible to cancel OnGridCellChanged events?

Question

I am using C#, Windows application.
Is it possible to cancel OnGridCellSelectChanged events?
I have a popup form that says do you wish to change yes/no, is there a way to cancel this event?

CODE:

private void gantt1_OnGridCellSelectChanged(Cell cell, CellSelectChangedEventArgs cellSelectChanged)
{
  bool temp;
  submitcancel SCForm = new submitcancel();
  SCForm.ShowDialog();
  temp = SCForm.getStatus();

  if(temp) {
    //continue}
  else {
    //ignore event

  }

}

Answer

The event fires when changes occur in the Selected property of the Cell. So in princip you will get one call when the first cell is unselected and another call when the new cell is selected.

To null out the action here you can simply toggle the Select value back; cell.Selected = ! cellSelectChanged.NowSelected //( possible recursive problem?)

But I think that you want to make sure that the Grid.GridStructure.FocusedCell is not changed, so something like this:

    private void grid1_OnBeforeFocusedCellChange(PlexityHide.GTP.Grid grid, BeforeFocusedCellChangeEventArgs beforeFocusChange)
    {
      // This event allows you do control when cells are focused (when user moves with click or arrow keys)
      if (beforeFocusChange.OldFocusedCell!=null && beforeFocusChange.NewFocusedCell!=null)
      {
        if (beforeFocusChange.OldFocusedCell.Column.Index==2 && beforeFocusChange.NewFocusedCell.Column.Index==1)
        {
          // For some reason I do want the user to be able to move backwards from cell2 to cell1 horizontally
          beforeFocusChange.NewFocusedCell=beforeFocusChange.OldFocusedCell;
        }
      }
    }