Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic MonthRange - current time (Read 1958 times)
BenWTS
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Jun 19th, 2008
MonthRange - current time
Jun 19th, 2008 at 7:14pm
Print Post  
Here is the issue I'm seeing. I added the MonthRange control to my form in April, so the CurrentTime is set to '4/13/2008' in the designer mode.

In the loading of the form I am doing the following:
mfMonthRange.BeginInit();
mfMonthRange.CurrentTime = DateTime.Today;
mfMonthRange.Selection.Set(DateTime.Today);
mfMonthRange.EndInit();

The problem is, although the selection is correctly set to today's date, the month is still displaying April instead of June. You have to actually hit the arrow buttons to scroll it over to June.

What am I doing wrong? Or how can I force it to display the correct month.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: MonthRange - current time
Reply #1 - Jun 20th, 2008 at 6:32am
Print Post  
The Calendar.CurrentTime property is only used when the control needs to find out which is the current date in order to paint it with a different color in certain views. It doesn't affect the currently visible set of dates. In order to scroll to a particular date programmatically, use the Calendar.Date property:

Code
Select All
mfMonthRange.Date = DateTime.Today; 


Meppy
  
Back to top
 
IP Logged
 
BenWTS
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Jun 19th, 2008
Re: MonthRange - current time
Reply #2 - Jun 24th, 2008 at 7:13pm
Print Post  
Thanks!

I figured it would end up being something simple like this but for whatever reason I didn't see the .Date property Smiley

And I wasn't seeing it being set in some of the samples I was checking like the "Dual View" sample.

Thanks again that worked fine.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint