10423 : Setting the start date of Gantt_ASP

Question

while I am using GTP.NET.WEB I tried to set the start date of the DataScler using any of the following commands:
Gantt_ASPSettings1.Gantt.DateScalerProperties.LowerBound = New Date (2004, 1, 1, 0, 0, 0, 0)
or
Gantt_ASP1.Gantt.DateScaler.StartTime = StartDate
But it doesnt work!!! Any help please?

Answer

Go like this:
      if (! this.IsPostBack) // If this is not a postback then we init the datetime to Today + 15 days
      {
        Gantt_ASP1.StartTime=DateTime.Today;
        Gantt_ASP1.StopTime=DateTime.Today.AddDays(15);
      }
You need to be carefull to check that this is not a postback, otherwise the date will not change when user tries to scroll

Leave a Reply