Calendar Control........

T

thomson

Hi,
When we drag a calendar control, you will be able to see the
previous and next month dates in the control[iam not talking about the
header], the dates,
I need to show only the dates for that particular month, is
that possible,[Everything is possible], but let me know how is it done

Thanks in Advance


Thomson
 
K

Ken Cox [Microsoft MVP]

Hi Thomson,

You just need to use the DayRender event to substitute a space for the date
if the day falls in a different month. Try this?

Private Sub Calendar1_DayRender _
(ByVal sender As Object, _
ByVal e As System.Web.UI. _
WebControls.DayRenderEventArgs) _
Handles Calendar1.DayRender
' Ken Cox Nov 9/2004
' Substitute a space if the day
' belongs to another month
If e.Day.IsOtherMonth Then
e.Cell.Text = " "
End If
End Sub

Does this help?

Ken
Microsoft MVP [ASP.NET]
 
S

Scott Mitchell [MVP]

thomson said:
When we drag a calendar control, you will be able to see the
previous and next month dates in the control[iam not talking about the
header], the dates,
I need to show only the dates for that particular month, is
that possible,[Everything is possible], but let me know how is it done

Thomson, if I understand you correctly, you want to not show the links
tot he next and previous month, just the date for the current month,
correct?

To do so, simply set the Calendar's ShowNextPrevMonth property to False.
That's all there is to it.

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPMessageboard.com
http://www.ASPFAQs.com

* When you think ASP, think 4GuysFromRolla.com!
 
T

thomson

Hi,
When we drag a calendar control, you will be able to see the
previous and next month dates in the control[iam not talking about the
header], the dates,
I need to show only the dates for that particular month, is
that possible,[Everything is possible], but let me know how is it done

Thanks in Advance


Thomson

Thank You Ken, and Scott for your answers? .......i was out of
touch for few days...was on vacation, Do let you know the results
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top