Web calendar control to display a single month only

M

M. D'Costa

Hello,

I am using the webcontrol calendar, and would like to display only a single
month. At the moment, the calendar displays running days from the previous
and next months also. e.g if displaying September 2004, days from August
2004 and October 2004 are visible also.

Help will be appreciated.
Thanks,
Marise
 
K

Ken Cox [Microsoft MVP]

Hi Marise,

One trick is to substitute a space for the date if the day is from a
different month:

Private Sub Calendar1_DayRender _
(ByVal sender As Object, _
ByVal e As System.Web.UI. _
WebControls.DayRenderEventArgs) _
Handles Calendar1.DayRender
If e.Day.IsOtherMonth Then
e.Cell.Text = " "
End If
End Sub

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto
 
M

M. D'Costa

Hi Ken,

Thanks very very much. That worked!

Marise
ps - do you have an email address where I can reach you with web control
questions? ;)

Ken Cox said:
Hi Marise,

One trick is to substitute a space for the date if the day is from a
different month:

Private Sub Calendar1_DayRender _
(ByVal sender As Object, _
ByVal e As System.Web.UI. _
WebControls.DayRenderEventArgs) _
Handles Calendar1.DayRender
If e.Day.IsOtherMonth Then
e.Cell.Text = " "
End If
End Sub

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto

M. D'Costa said:
Hello,

I am using the webcontrol calendar, and would like to display only a
single
month. At the moment, the calendar displays running days from the previous
and next months also. e.g if displaying September 2004, days from August
2004 and October 2004 are visible also.

Help will be appreciated.
Thanks,
Marise
 
K

Ken Cox [Microsoft MVP]

Hi Marise,

Glad to hear it helped you.

Sorry, I don't answer questions by e-mail. Apart from the volume of
questions being overwhelming, sticking to the public newsgroups ensures that
everyone can benefit from answers.

Ken
MVP [ASP.NET]


M. D'Costa said:
Hi Ken,

Thanks very very much. That worked!

Marise
ps - do you have an email address where I can reach you with web control
questions? ;)

Ken Cox said:
Hi Marise,

One trick is to substitute a space for the date if the day is from a
different month:

Private Sub Calendar1_DayRender _
(ByVal sender As Object, _
ByVal e As System.Web.UI. _
WebControls.DayRenderEventArgs) _
Handles Calendar1.DayRender
If e.Day.IsOtherMonth Then
e.Cell.Text = " "
End If
End Sub

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto

M. D'Costa said:
Hello,

I am using the webcontrol calendar, and would like to display only a
single
month. At the moment, the calendar displays running days from the previous
and next months also. e.g if displaying September 2004, days from August
2004 and October 2004 are visible also.

Help will be appreciated.
Thanks,
Marise
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top