Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic TimeTableView - select visible date (Read 4510 times)
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
TimeTableView - select visible date
Mar 2nd, 2017 at 4:37pm
Print Post  
Hi Meppy,
Sorry for so many questions. I need to set the calendar dates to a wider range of dates but then select one of the dates to be the first visible. The user can then scroll horizontally between the other dates. I can not see how to do that.

Thank you,
John
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: TimeTableView - select visible date
Reply #1 - Mar 3rd, 2017 at 10:38am
Print Post  
Hi,

You can assign the date index within TimetableSettings.Dates to calendar's ScrollPosition.X -

Code
Select All
// starts from the 5th date zero based
calendar.ScrollPosition = new Point(4, 0); 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Re: TimeTableView - select visible date
Reply #2 - Mar 3rd, 2017 at 4:49pm
Print Post  
I am having trouble getting the date index in Timetable Dates. I am using the following

calendar.TimetableSettings.Dates.IndexOf(Cdate("11/22/2017")) and it returns -1 but that date is on my calendar.

What am I doing wrong?

Thank you,
John
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: TimeTableView - select visible date
Reply #3 - Mar 3rd, 2017 at 5:07pm
Print Post  
The Dates element might be unequal to the value you compare with if it has non-zero Time properties set. Try looping over the collection and comparing only the DateTime.Date values to find the index.
  
Back to top
 
IP Logged
 
john6630
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Sep 20th, 2010
Re: TimeTableView - select visible date
Reply #4 - Mar 3rd, 2017 at 5:23pm
Print Post  
My mistake. Using indexOf works fine. I had the wrong year in my test date.

Thank you,
John
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint