|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Calendar Web ControlBy default the calendar control displays not only the current month, but also the days from the previous and the next month (6 weeks total). Is there a way to prevent days from other months from showing up on the calendar? Example: If the user selects January 2007, I don't want days displayed from December and February. I hope that makes sense. Thanks in advance for your help, Chris Here's what I got from the MSDN help: The Calendar control displays the dates for one month at a time, with a total of six weeks appearing at once. The control supports several types of dates, which are described in the following table. Hello Chris.
It took me some time to figure this out. It's the OtherMonthDayStyle properties. Good luck. Tony Show quoteHide quote "Chris Beres" <ChrisBe***@discussions.microsoft.com> wrote in message news:1A1FAD2E-21D0-4EE0-B1CF-76888C7F4CB6@microsoft.com... > Greetings, > > By default the calendar control displays not only the current month, but > also the days from the previous and the next month (6 weeks total). Is > there > a way to prevent days from other months from showing up on the calendar? > Example: If the user selects January 2007, I don't want days displayed > from > December and February. > > I hope that makes sense. > > Thanks in advance for your help, > > Chris > > Here's what I got from the MSDN help: > > The Calendar control displays the dates for one month at a time, with a > total of six weeks appearing at once. The control supports several types > of > dates, which are described in the following table. Hi Chris,
You can use the DayRender to check if the day is from another month (IsOtherMonth ) and if so, substitute a space character. Check out the code below and let us know if this helps? Ken Microsoft MVP [ASP.NET] <%@ page language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> 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 </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:calendar id="Calendar1" runat="server"></asp:calendar> </div> </form> </body> </html> Show quoteHide quote "Chris Beres" <ChrisBe***@discussions.microsoft.com> wrote in message news:1A1FAD2E-21D0-4EE0-B1CF-76888C7F4CB6@microsoft.com... > Greetings, > > By default the calendar control displays not only the current month, but > also the days from the previous and the next month (6 weeks total). Is > there > a way to prevent days from other months from showing up on the calendar? > Example: If the user selects January 2007, I don't want days displayed > from > December and February. > > I hope that makes sense. > > Thanks in advance for your help, > > Chris > > Here's what I got from the MSDN help: > > The Calendar control displays the dates for one month at a time, with a > total of six weeks appearing at once. The control supports several types > of > dates, which are described in the following table.
Compiler Error Message: BC30456: 'btnGAT_onClick' is not a member of 'ASP.WebForm1_aspx'
Confirm Message in gridview Object data source, setting parameter source to Page.Partner.Guid Search in .NET User controls and LoadControl method Slow File Upload Speed IIS 6.0 ASP.net 2.0 How to use .Net controls in regular ASP RowCommand Event of a nested Gridview How to assign access key to MenuItem RegularExpressionValidator |
|||||||||||||||||||||||