Welcome Guest Search | Active Topics | Sign In | Register

Calendar Display Options
Phillip
Posted: Friday, August 29, 2008 8:42:48 AM
Rank: Newbie
Groups: Member

Joined: 8/28/2008
Posts: 3
When you load a multi-month calendar, the month of the current date is displayed in the upper left, and future months fill out the rest of the calendar. Is there a way to have the selected month be the last month displayed, and have previous months show up instead of future months?

For example, if the selected date was August 1, 2008, a 4-month calendar will show Aug/Sept/Oct/Nov. I would like it to show May/June/July/Aug instead.
eo_support
Posted: Friday, August 29, 2008 8:50:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

I do not think there is an option to control that. One thing you can try is to set the Calendar's VisibleDate property. That property controls which month would be the first visible month. I believe setting SelectedDate automatically set VisibleMonth, however setting VisibleMonth does not change SelectedDate.

Thanks
Phillip
Posted: Friday, August 29, 2008 9:30:28 AM
Rank: Newbie
Groups: Member

Joined: 8/28/2008
Posts: 3
Thanks! That seems to work when the control is first rendered, but once you pick another date that month is set as the first month. I set the AutoPostbackOnSelect to True and reset the VisibleDate property in the SelectionChanged event, but that doesn't seem to have any effect.

Protected Sub DatePicker1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DatePicker1.SelectionChanged
DatePicker1.VisibleDate = DateAdd(DateInterval.Month, -3, DatePicker1.SelectedDate)
End Sub

Stepping through the code, VisibleDate gets set correctly, but it doesn't seem to pass through to the display.
eo_support
Posted: Friday, August 29, 2008 9:33:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
That's interesting. We will take a look and let you know what we find.
eo_support
Posted: Sunday, August 31, 2008 4:54:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

We have posted a new build that fixed this problem. Please download it from our download page.

Thanks!
Phillip
Posted: Sunday, August 31, 2008 8:47:02 PM
Rank: Newbie
Groups: Member

Joined: 8/28/2008
Posts: 3
Works perfectly now, thanks!

Here's the code for anyone else trying to do this:

Protected Sub DatePicker1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles DatePicker1.PreRender
If DatePicker1.SelectedDate = #12:00:00 AM# Then
DatePicker1.VisibleDate = DateAdd(DateInterval.Month, -3, Now)
Else
DatePicker1.VisibleDate = DateAdd(DateInterval.Month, -3, DatePicker1.SelectedDate)
End If
End Sub
eo_support
Posted: Sunday, August 31, 2008 9:00:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Thanks for the update!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.