Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ResourceView number of displayed days (Read 4344 times)
Darko
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Nov 1st, 2007
ResourceView number of displayed days
Nov 19th, 2007 at 4:30pm
Print Post  
Hi,

I'm sure I'm missing something very simple, but, is there a setting somewhere to set a maximum number of displayed days in a Resource view?

OR, an alternative, is it possible to rotate items in a Horizontal TimeLine view?

Thanks,
Darko
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ResourceView number of displayed days
Reply #1 - Nov 20th, 2007 at 6:18am
Print Post  
You can increase and decrease the scale of the timelines (by modifying the value of the ResourceViewSettings.TimelineScale property), thus effectively increasing or decreasing the number of days visible in the view. For example, if by default you have 10 days visible in the view and you want to have 5 days visible, set the value of TimelineScale to 200.

As for the rotated items in a Timetable view - you have to use custom drawing to achieve that. There is no built-in property for it.

Meppy
  
Back to top
 
IP Logged
 
Darko
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Nov 1st, 2007
Re: ResourceView number of displayed days
Reply #2 - Nov 20th, 2007 at 9:25am
Print Post  
Meppy wrote on Nov 20th, 2007 at 6:18am:
You can increase and decrease the scale of the timelines (by modifying the value of the ResourceViewSettings.TimelineScale property), thus effectively increasing or decreasing the number of days visible in the view. For example, if by default you have 10 days visible in the view and you want to have 5 days visible, set the value of TimelineScale to 200.


Thanks, but it seems that the number of initially visible days is dependent on the calendar control size (which varies depending on the form size, in my case), which means I cannot know how many days are actually visible. Is that correct?

Darko
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ResourceView number of displayed days
Reply #3 - Nov 20th, 2007 at 10:01am
Print Post  
Yes, this is correct. Unfortunately it is not possible to specify a fixed number of days for a calendar with dynamic size.

Meppy
  
Back to top
 
IP Logged
 
Sepster
YaBB Newbies
*
Offline



Posts: 1
Joined: Jul 17th, 2008
Re: ResourceView number of displayed days
Reply #4 - Jul 17th, 2008 at 11:41am
Print Post  
Late reply, so hope this helps.

A rough solution is to scale the timeline in accordance with the resize ratio.

First we need to record the "design-time" settings at run time, so they can be used to calculate resize ratios.

[code]
public partial class Form1 : Form
{
private int _originalCalWidth;
private int _originalCalTimeLineScale;
private int _originalCalRowHeaderWidth;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
_originalCalWidth = calendar.Size.Width;
_originalCalTimeLineScale = calendar.ResourceViewSettings.TimelineScale;
_originalCalRowHeaderWidth = calendar.ResourceViewSettings.RowHeaderSize;

....

}
[/code]

Then we handle the form's (or control's, I guess?) resize event:

[code] private void Form1_ResizeEnd(object sender, EventArgs e)
{
double ratio = ((float)(calendar.Size.Width - _originalCalRowHeaderWidth) / (_originalCalWidth - _originalCalRowHeaderWidth));
calendar.ResourceViewSettings.TimelineScale = (int)(ratio * _originalCalTimeLineScale);
}
[/code]

It's not especially pretty, but worked well enough for what I needed. Hope it helps someone!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint