10486 : TimeMoveMarkers that snap?

Question

Is it possible that the TimeItems and the TimeMoveMarkers snap in during moving or resizing the TimeItems dependent on the adjusted SnapStartTime/SnapStopTime?

Answer

I see your point, it would be a neat feature. Currently you will need to implement the OnTimeItem_Hoover, and check and change the e.Diff (the actual change) to a snapped value. The snapping can called from this event via gantt1.DateScaler.SnapStart(…

10494 : Is it possible to scroll smooth?

Question

Is it possible to scroll smooth? I have a gantt, where three items are in. And when i increase the height of the items so that it is almost my entire screen and i wanna scroll down a little bit that i can increase the height more, it is not possible, cause the scroll makes a huge jump to the next item.

Answer

The x direction of the Grid scrolls per pixel, so does the time line of the Gantt. The Y-axis of the Grid currently scrolls by rows. This has to do with some design decisions that were made to allow for individual row heights and fast scrollbar handling.

So short answer is: No it is currently not supported to smooth scroll the Y direction of the grid. We are adding this to our list of possible future features.

 

10473 : Images after each timeitem. How can I disable this?

Question

In some cases I need to display an image behind a timeitem, so I attached an imagelist to the grid. Since I’ve installed your new version (2.3), the grid displays images after each timeitem. Setting the imageindex to nothing doesn’t work. How can I disable this?

Answer

The new version allows for images on each TimeItemText. When you use a TimeItemText and you do not want/need an image you set the TimeItemTextLayout.ImageIndex=-1

      TimeItemText tit=new TimeItemText();
      string[] names={“First”,“Second”,“Third”,“Fourth”,“Fifth”};
      tit.Text=names[random.Next(0,4)];
      tit.TimeItemTextLayout=new TimeItemTextLayout();
      tit.TimeItemTextLayout.Font=new Font(“Microsoft Sans Serif”,8,FontStyle.Bold);
      tit.TimeItemTextLayout.Color=Color.Black;
      tit.TimeItemTextLayout.HorzAlign=StringAlignment.Near;
      tit.TimeItemTextLayout.VertAlign=StringAlignment.Center;
      tit.TimeItemTextLayout.OutsideText=true; // The text will be put outside the time item
      tit.TimeItemTextLayout.ImageIndex=random.Next(0,4);
      //tit.TimeItemTextLayout.ImageIndex=-1;
      ti.TimeItemTexts.Add(tit);

10480 : Populate Gantt_ASP without Windows form

Question

Hello,
I currently try your GTP.NET (version 2.3.1) component and
I would like to fill it with a dataset without instantiate a System.Windows.Forms.Form like in your sample.
Is it possible? Have you got a sample?
Thanks a lot,

Answer

I take it you want to use Gantt_ASP and you would like to avoid to use the windows form as we did in one of the supplied sample.

This can be done, but I regretfully have no such sample at this time. What you can do is simply copy the WindowsForms auto generated code to the aspx.cs page and put in a Init method.

You will still need to include the Windows.Forms assembly becuase your page now includes the GTP.Gantt that inherits from Control.

 

 

10472 : Multipageprint, page control

Question

I’m trying to print my grid, with some help of the samples in this knowledge base. I succeeded almost, but I need some explanation of the parameters that go with the PrintPage event:

Overloads Public Sub PrintPage( _
   ByVal G As Graphics, _
   ByVal Margins As Rectangle, _
   ByVal aGridWidth As Integer, _
   ByVal aDateScalerHeight As Integer, _
   ByVal suppressGrid As Boolean, _
   ByRef HasMorePages As Boolean, _
   ByVal doNotStepGridWillPrintTheSameRowsOneMoreTime As Boolean _
)

What exactly do the HasMorePages and doNotStepGridWillPrintTheSameRowsOneMoreTime parameters mean, and how should I use them?

Answer

The HasMorePages is a value that will be set to true if the content did not fit on the space given. If it does fit, the HasMorePages will be set to false.

The Grid prints the visible nodes to the given space and remembers the first node that did not fit. This node will be the first on the next page that is produced when you call PrintPage again.

If you want to produce multiple pages in the x-direction (Like a chart that needs 5 pages across the time direction) you need to instruct the grid that it should not start next print on the first node that did not fit, but rather on the same node as last time… You do this by setting the doNotStepGridWillPrintTheSameRowsOneMoreTime = true.

There is a sample of the multi page print with two pages across the time axis in the general download. The sample is called GanttTest.

This is a comment from that sample:

// In this print I choose to divide the time axel into two pages.
// Then I must call PrintPage once with SuppressGrid=false and doNotStepGridWillPrintTheSameRowsOneMoreTime=true
// and once with SuppressGrid=true and doNotStepGridWillPrintTheSameRowsOneMoreTime=false
// In the second call I change the DateScaler intervall to reflect another area in time, then I set it back
// after the print to prepare for the first page in time (x) direction

 

10469 : Controlling resolution

Question

I want to lock the datescaler on a certain scale. I added the following code:

            Gantt1.DateScaler.ResizeType = ResizingType.StartLocked
            Gantt1.DateScaler.ReScaleWithControl = True

            Gantt1.DateScaler.StartTime = Date.Now
            Gantt1.DateScaler.StopTime = Gantt1.DateScaler.StartTime.AddDays(14)
            Gantt1.DateScaler.ZoomIntoResolution = NonLinearTime.TimeResolution.days

Now the datescaler will display two weeks, regardles of the width. I want to be able to set the scale of the datescaler (which I tried with the ZoomIntoResolution, but didn’t work out) and a startdate, just like M$ Project does.

In another answer, you suggested to implement the onDateScaleChangeEvent, to change the scale back to its original value. Can you be more specific? Maybe it’s part of the solution.

Answer

ZoomIntoResolution controls the lowest resolution available to the user.

The resolution is defined as VisibleTime/Space

You can also set the MinSpan property; this controls how much VisibleTime that must be on screen.

If you experiment with the scale and do something like this:
    private void dateScaler1_OnScaleChangeEvent(object sender, EventArgs e)
    {
      TimeSpan ts=(dateScaler1.StopTime.Subtract(dateScaler1.StartTime));
      double scale=(ts.Ticks /dateScaler1.Width);
      labelCurrentScale.Text = "Current scale: " + scale.ToString();
    }

You will find that you can produce a given resolution like this:
    private void buttonSetScaleToDays_Click(object sender, EventArgs e)
    {
      long scale = 20000000000;
      TimeSpan x=new TimeSpan(scale*dateScaler1.Width);
      dateScaler1.StopTime=dateScaler1.StartTime.Add(x);
     
    }

    private void buttonSetScaleToYears_Click(object sender, EventArgs e)
    {
      long scale = 1510000000000;
      TimeSpan x = new TimeSpan(scale * dateScaler1.Width);
      dateScaler1.StopTime = dateScaler1.StartTime.Add(x);

    }

Knowing this you can do the same calculations in the OnBeforeScaleOrSpanChange event and react to resolutions that you do not want and fix them by changing the e.NewStartTime and e.NewStopTime to valid values

10465 : Gantt_ASP scrolling postbacks

Question

I am using Gantt.NET 2.0 in my web appplication.

I have developed the code based on the sample web application in GTP .NET 2.0.

Each time when I click the Scroll Bar, that is in the top of the Gantt chart that helps me to move between the start and end dates of the chart, it goes to the server side. Can i restrict the scroll click to the client side so that it need not go to server each time the scroll (left or right scroll) image is clicked?

but i need to move between the start and end dates of the chart.

Answer

Currently we only support postback scrolling. It would be reasonable to allow for a small client side scroll and we will look into this for future releases but currently the post back is required.

10462 : I have a large grid in my GanttAsp with about 2500 rows. If I have a row-height of about 22px this gives me a total height of 55000px…

Question

I have a large grid in my GanttAsp with about 2500 rows. If I have a row-height of about 22px this gives me a total height of 55000px…
The problem is that the maximum height seems to be 32767px (2^15-1)!
When I try to set a larger height i get the message “Specified argument was out of the range of valid values. Parameter name: value”

Is there some workaround for this or do I have to live with it?

Thanks a lot

Answer

Actually we had another client with the exact same problem earlier and we introduced a fix that is available in the latest patch:

Gantt_ASP.HeightExtreme = The Height for a server side control is given in the Unit type. This type is limited to 32767 To overcome this restriction set HeightExtreme to a positive value that is your desired height in pixels.

10453 : Columns and paging problems in Gantt_ASP

Question

I’m using Gantt ASP to display a paged list with 12 columns!

But, I’m experiencing two problems:
1.) The paging is rendered into a TableCell with colspan=2 no matter how many columns i have.
2.) The paging works, but only to page 3. From page 4 and on, the displayed page is always empty!

I don’t understand what I’m doing wrong, can you help me?

The data is added as RootNodes, not with DataBinding!

Thanks a lot!

Answer

This surely sounds like some of the early version bugs we had; make sure you use the latest patches from here

download the assemblies as patches:https://plexityhide.com/pub/PlexityHide.GTP.zip
And for the web: https://plexityhide.com/pub/PlexityHide.GTP.WEB.zip

10451 : Could you please help me to get content of grids cell (SingleText) during editing.

Question

Hello guys. Could you please help me to get content of grid’s cell (SingleText) during editing. I can use onAfterEdit and onBeforeEndEdit, but I need content of cell during editing -for example, if I’m typing word in the cell and want to repeat this word in another field during typing, not after end editing. If you have any sugestions. Thanks a lot.

Answer

In the OnBeforeEditCell event you can set up a event handler to the inplace editor that will be used in the edit. You gain access to the Editor here: Grid.CurrentEditor (make sure you have a late version, this is rather new)

(Gantt.Grid.CurrentEditor as TextBox).TextChanged += new System.EventHandler(this.inplaceedit_TextChanged);