Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Resource View By Hours (Read 2150 times)
effxz_prg
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Jan 30th, 2013
Resource View By Hours
Jan 30th, 2013 at 9:17pm
Print Post  
Sorry I am a newbie to this control, is there a way to set the resource view to display only one day? and have a more detailed breakdown in hours for this view?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Resource View By Hours
Reply #1 - Jan 31st, 2013 at 7:20am
Print Post  
Hi,

You can set the units and the format of the timelines in a Resource view through the respective properties in Calendar.ResourceViewSettings - BottomTimelineSettings, MiddleTimelineSettings, and TopTimelineSettings. For example, to setup the middle timeline to display days and the bottom timeline to display hours (both with the appropriate formatting), use the following code:

Code
Select All
calendar.ResourceViewSettings.MiddleTimelineSettings.Unit = TimeUnit.Day;
calendar.ResourceViewSettings.MiddleTimelineSettings.Format = "dd MMM";
calendar.ResourceViewSettings.BottomTimelineSettings.Unit = TimeUnit.Hour;
calendar.ResourceViewSettings.BottomTimelineSettings.Format = "HH:mm"; 


If you don't need the middle timeline, set Calendar.ResourceViewSettings.Timelines to 1. In addition, you may also want to set ScrollStep and SnapUnit to more appropriate values for the new view resolution, for example one hour:

Code
Select All
calendar.ResourceViewSettings.ScrollStep = TimeSpan.FromHours(1);
calendar.ResourceViewSettings.SnapUnit = TimeUnit.Hour; 


Finally, to display only a single day, set the Calendar.EndDate property. Optionally set Calendar.ResourceViewSettings.ShowPaddingDates to Disabled if you don't want the hours from the following day to be visible in case there is extra space available:

Code
Select All
calendar.EndDate = calendar.Date.AddDays(1); 


I hope this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint