Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SetViewPort() in ResourceView (Read 10463 times)
Achim
Junior Member
**
Offline


MindFusion rocks!

Posts: 70
Location: Bayreuth, Germany
Joined: Jun 28th, 2012
SetViewPort() in ResourceView
Apr 4th, 2014 at 12:53pm
Print Post  
Hi there,

I just wanted to implement some "fit to content" functionality and stumbled upon SetViewPort() which looks it should do the job for me Smiley Luckily it works as espected but only one time. When I call the function a second time the result gets weird: the timeline gets very long and no items are visible on the chart. When I scroll up and down a bit and then call SetViewPort() again, sometimes it works correctly again. I'm sure I pass always the same arguments to the function (StartTime, EndTime and the scale flag).

Any help on this?

Best regards
Achim
  
Back to top
WWW  
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SetViewPort() in ResourceView
Reply #1 - Apr 7th, 2014 at 5:53am
Print Post  
Hi,

This appears to be a bug. Please, check if the trial version below addresses the issue. A release with the fix will be available later.

https://mindfusion.eu/_temp/MindFusion.Scheduling.5.5.1.trial.zip

Regards,
Meppy
  
Back to top
 
IP Logged
 
Achim
Junior Member
**
Offline


MindFusion rocks!

Posts: 70
Location: Bayreuth, Germany
Joined: Jun 28th, 2012
Re: SetViewPort() in ResourceView
Reply #2 - Apr 7th, 2014 at 7:42am
Print Post  
Hi Meppy,

thank you, seems to work as expected Smiley Please let me know when the release is available.

Regards
Achim
  
Back to top
WWW  
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SetViewPort() in ResourceView
Reply #3 - Apr 7th, 2014 at 10:38am
Print Post  
Hi,

We do not have a set date for the next official release. I have sent you private message with a temporary link to the most recent licensed assemblies of MindFusion.Scheduling. These assemblies also include the Drawing event we discussed earlier.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Achim
Junior Member
**
Offline


MindFusion rocks!

Posts: 70
Location: Bayreuth, Germany
Joined: Jun 28th, 2012
Re: SetViewPort() in ResourceView
Reply #4 - Apr 7th, 2014 at 11:31am
Print Post  
Hi Meppy,

thanks a lot four your fast response.

I've double checked the functionality of SetViewPort() in the meantime and found two little issues:

1. sometimes I have to call the method twice in order to get the expected result (after the first call I can see about 90% of the content, after the second I see the exact range)

2. When I  call SetViewPort() call a horizontal scroll bar remains which scrolls a little bit more than the given range. This is also the case when I set a wider range than defined by calendar.Date and calendar.EndDate.

Thanks for your support
Achim
  
Back to top
WWW  
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SetViewPort() in ResourceView
Reply #5 - Apr 7th, 2014 at 2:19pm
Print Post  
Hi,

Are you able to provide me with your settings at the time these problems happen? More specifically, the timeline settings of the view.

Regards,
Meppy
  
Back to top
 
IP Logged
 
SGS Software
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 22
Joined: Jul 28th, 2014
Re: SetViewPort() in ResourceView
Reply #6 - Sep 30th, 2014 at 1:21pm
Print Post  
Hi, I pick this topic up instead of opening a new one.
My scenario is ResourceView, VB.NET

Can I set again my own format of each date/time row
after I set the parameter "adjustResolution" True?

There is a method to handle the format to make it custom?
For example, I want to make day week name one char only (M,T,W,T,F,S,S)
or make the month name uppercase...is it possible?

Thank you.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SetViewPort() in ResourceView
Reply #7 - Sep 30th, 2014 at 2:42pm
Print Post  
Hi,

You can customize the texts displayed in the timelines of the Resource view through the Format property of the respective TimelineSettings object, that is, ResourceViewSettings.TopTimelineSettings, ResourceViewSettings.MiddleTimelineSettings, and ResourceViewSettings.BottomTimelineSettings for the top, middle, and bottom timelines respectively. The accepted values for the Format property are the standard date and time formatting specifiers, as outlined in the Custom Date and Time Format Strings topic of the MSDN documentation. However, I don't think there is a specifier for just the first letter of the day of the week.

You have the following two options:

You can set the format to "ddd" (The abbreviated name of the day of the week.) and replace the abbreviated day names globally, by setting the Calendar.DateTimeFormat.AbbreviatedDayNames:

Code
Select All
calendar.DateTimeFormat.AbbreviatedDayNames = New String() {"S", "M", "T", "W", "T", "F", "S"} 


Specifying uppercase month names can be done in a similar fashion by setting the Calendar.DateTimeFormat.MonthNames property. Keep in mind that this will affect the display of the abbreviated day names and months throughout the entire control.

Alternatively, you can handle the Calendar.CustomizeText event and provide the texts yourself. To provide texts for the resource view timelines, you need to check if the value of the Element property of the event argument equals CalendarTextElements.ResourceViewTimeline. You need to analyze the date of the cell being processed and return a corresponding text value. The following event handler returns uppercase month names for the cells in the middle timeline and a single-letter day names for the cells in the bottom timeline:

Code
Select All
If e.Element = CalendarTextElements.ResourceViewTimeline Then
	If e.Index = 1 Then
		' Middle timeline
		e.Text = calendar.DateTimeFormat.MonthNames(e.[Date].Month - 1).ToUpper()
	ElseIf e.Index = 2 Then
		' Bottom timeline
		e.Text = calendar.DateTimeFormat.AbbreviatedDayNames(CInt(e.[Date].DayOfWeek))(0).ToString()
	End If
End If 


Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
SGS Software
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 22
Joined: Jul 28th, 2014
Re: SetViewPort() in ResourceView
Reply #8 - Sep 30th, 2014 at 3:05pm
Print Post  
The "AbbreviatedDayNames" is the best and quick solution for me, now!

Before, I was thinking about a CustomDraw event, but "e.Text" was ReadOnly, didn't know about CustomizeText event, so I ended up with draw a rectangle cointaining a string...same result (maybe) but more elaborate!

Thank you!

What about the other question about set again the format after
SetViewPort with "adjustResolution" = True?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SetViewPort() in ResourceView
Reply #9 - Oct 1st, 2014 at 6:15am
Print Post  
Hi,

You can set the format of the dates in the timelines through the Format property of the respective TimelineSettings object. For example, to set the format of the bottommost timeline, you could use the following code:

Code
Select All
calendar.ResourceViewSettings.BottomTimelineSettings.Format = "ddd" 


I hope this helps.

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