Katalogerna
PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


GTP.NET FAQ 11013


I want to increase and decrease the date scaler resolution manually on some buttons. Hows this possible... ? Please note that this article refers to the GTP.NET
Jump to article- 2007-10-16 20:24:00 - Email plexityHide

Question

Hello support,

    I want to increase and decrease the date scaler resolution manually on some buttons. How's this possible... ? It will help me if you provide the code.

Answer

private void ZoomMinus_Click(object sender, System.EventArgs e)
{
        gantt1.DateScaler.StartTime=gantt1.DateScaler.StartTime.AddDays(2);
        gantt1.DateScaler.StopTime=gantt1.DateScaler.StopTime.AddDays(-2);
}

private void ZoomPlus_Click(object sender, System.EventArgs e)
{
        gantt1.DateScaler.StartTime=gantt1.DateScaler.StartTime.AddDays(-2);
        gantt1.DateScaler.StopTime=gantt1.DateScaler.StopTime.AddDays(2);
}

This way we do it in Gantt_ASP, and it works better because it always zooms half of the span, no matter the current resolution...

      if (eventArgument == "scaleinc")
      {
        TimeSpan ts=StopTime.Subtract(StartTime);
        ts=new TimeSpan(ts.Ticks/4);
       
        StartTime=StartTime.Subtract(ts);
        StopTime=StopTime.Add(ts);
      }
      else
      if (eventArgument == "scaledec")
      {
        TimeSpan ts=StopTime.Subtract(StartTime);
        ts=new TimeSpan(ts.Ticks/4);
       
        StartTime=StartTime.Add(ts);
        StopTime=StopTime.Subtract(ts);
      }

 

 

Google
WWW plexityHide GTP.NET FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ general

Testimonials

"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%"
Gaurav Patole,
WebTechDevelopers
More testimonials...