Intersoft Support Center

Use Disabled Time in Timeline View

Disabled time is a unique feature which enables developer to specify a portion of time when event creation is disabled without requiring complex efforts or codes.

There are 3 options available in using Disabled Time:

  • Global Disabled Time
  • Resource Disabled Time
  • Partial Disabled Time

In this topic, you will learn how to use Disabled Time with these 3 options.


Global Disabled Time will affect all of the resources in Timeline.  Global Disabled Time can be defined in design time or runtime.

In this topic, you will learn how to perform global disabled time using WebScheduler’s properties.

To create Global Disabled Time in Timeline View

  1. Right-click on WebScheduler’s control and choose Properties.
  2. In Properties box, Select DisabledTime and open its Collection.
  3. Set SelectedViewMode to Timeline.
  4. Set StartTime and EndTime according to your needs. In this sample, StartTime is set to “3/1/2008” and EndTime is set to “3/2/2008”.




Resource Disabled Time will only affect the resource itself; the effect will not influence other resources in Timeline.

In this topic, you will learn how to set Resource disabled time in runtime using OnDataBound server-side event and populate to WebScheduler using PopulateDisabledTime server side method.

To create Resource Disabled Time

Place the following code under DataBound server-side event: 

C# Copy ImageCopy Code
protected void WebScheduler1_DataBound(object sender, ISNet.WebUI.WebScheduler.WebSchedulerDataBoundDataArgs e)
{        
   if (e.Type == ISNet.WebUI.WebScheduler.WebSchedulerObjectType.Resource)        
   {            
      WebSchedulerResource data = e.DataObject as WebSchedulerResource;             
      
      if (data.ResourceID == 1)            
      {                
         DataTable dt = new DataTable("DisabledTime");                
         DataColumn dc = new DataColumn("StartTime", Type.GetType("System.DateTime"));                
         DataColumn dc2 = new DataColumn("EndTime", Type.GetType("System.DateTime"));                 
         dt.Columns.Add(dc);                
         dt.Columns.Add(dc2);                 

         DataRow dr = dt.NewRow();                
         dr["StartTime"] = new DateTime(2008, 3, 2);                
         dr["EndTime"] = new DateTime(2008, 3, 3);                
         dt.Rows.Add(dr);                 

         dr = dt.NewRow();                
         dr["StartTime"] = new DateTime(2008, 3, 10);                
         dr["EndTime"] = new DateTime(2008, 3, 11);                
         dt.Rows.Add(dr);                 

         WebSchedulerResource schedulerResource = e.DataObject as WebSchedulerResource;
         schedulerResource.PopulateDisabledTime(dt, "StartTime", "EndTime");            
      }        
   }
}



In Timeline, the cell that include in the disabled time’s date time will use TimelineDisabledTimeCellStyle. Same with other style in WebScheduler, TimelineDisabledTimeCellStyle is also customizable.

Partial disabled time is a combination between global and resource disabled time. For partial disabled time cell, WebScheduler will give differentiate on the Timeline cell by put a small “padlock” icon in the top right of the cell.

In this topic, you will learn how to create partial disabled time using both global and resource disabled time.

To create Partial Disabled Time

Global Partial Disabled Time

  1. Right-click on the WebScheduler’s control and choose Properties.
  2. In Properties box, Select DisabledTime and open its Collection.
  3. Set StartTime and EndTime according to your needs. In this sample, StartTime is set to “3/9/2008 1:00PM” and EndTime is set to “3/9/2008 2:00PM”.

Resource Partial Disabled Time

Put the following code under DataBound server side event: 

C# Copy ImageCopy Code
protected void WebScheduler1_DataBound(object sender, ISNet.WebUI.WebScheduler.WebSchedulerDataBoundDataArgs e)
{       
   if (e.Type == ISNet.WebUI.WebScheduler.WebSchedulerObjectType.Resource)       
   {           
      WebSchedulerResource data = e.DataObject as WebSchedulerResource;          
      if (data.ResourceID == 5)           
      {               
         DataTable dt = new DataTable("DisabledTime");               
         DataColumn dc = new DataColumn("StartTime", Type.GetType("System.DateTime"));               
         DataColumn dc2 = new DataColumn("EndTime", Type.GetType("System.DateTime"));               
         DataColumn dc3 = new DataColumn("ResourceID", Type.GetType("System.Int32"));              
         dt.Columns.Add(dc);               
         dt.Columns.Add(dc2);               
         dt.Columns.Add(dc3);              
         
         DataRow dr = dt.NewRow();               
         dr["StartTime"] = new DateTime(2008, 3, 3, 8, 0, 0);               
         dr["EndTime"] = new DateTime(2008, 3, 3, 9, 0, 0);               
         dt.Rows.Add(dr);    

         WebSchedulerResourceschedulerResource = e.DataObject as WebSchedulerResource;
         schedulerResource.PopulateDisabledTime(dt, "StartTime", "EndTime");           
      }       
   }
}
                


Previous Next